-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forms always appear to have changed in Git #5
Comments
I noticed this as well, my thought was to put a date stamp comment in the code. To elaborate, before it's exported, modify the first line in the code to have the timestamp of when it was last exported, kind of like .bas files. Anyway, the flow would be...
In all honesty, I was thinking about doing this with all files, I'm afraid that I'm going to edit something in the exported file, forget, and then overwrite it by exporting from the add in. There needs to be some sort of QA check here (in my opinion). Thoughts? |
Another option, while very involved, would be to modify the entire exporting function to, rather than use the official VBA module export function, use a file stream. This would also resolve the issue with class files because, apparently class files cannot just be imported via macros. I read a solution (that I also mentioned in the class files issue) in which the user stated that class files but be created via file input streams. That is, creating a new class object and then reading in the text. Obviously this would be a huge overhaul but, if it's the most error free and accurate way... Just throwing it out there. This solution would also allow you to put the Time-stamp in the first line without the developer ever needing to see it in the VBA Project IDE just like the attribute line I mentioned in a previous comment. |
gberl001, I'm not completely certain I understand where those two date stamps you're referring to are coming from. My assumption is: If I understand correctly, I'm not sure these date stamps will get what we want. If projectCodeDate is scoped on the project level, a change in another part of the code (a module for instance) would trigger an export even if the individual Form wasn't updated. For your issue of editing something in the exported file, this also won't resolve that unless you remember to manually change that date stamp (which would be error prone). Lastly, the .frx files are binary (not the .frm files, which are the code attached to the form, .frx is the form itself), so I'm not sure how to put the date stamp in there to begin with. I don't know enough about the file stream method to know if that's a viable option. Would that create identical FRX binary files regardless of when they are exported? It would be great to fix the class file import issue, although export will be far more common than import for my workflow at least. |
Yeah, that's what I meant by project modified date being scoped to the This shows up in the commit (unless I manually exclude the file) even when I didn't realize you were concerned with overwriting a newer export - I |
Okay, I think I'm going to go ahead and develop option 2; we're just Note - I have a pull request out to Hilkoc that adds the 'always export on I will add the 'ask to overwrite' as a custom setting; but I'll probably Neal |
On a mildly related note, do you put your Excel files/tools (VBA + |
Personally, I follow the method described here, although I do not use release branches, I work on Dev to fix bugs and add in features planned for the next release, features not complete have their own branches. I also have a fixed setting in my gitconfig to use --no-ff for all merges (to keep history). |
Yes, I follow something very similar (actually based off that same post), For Excel files, I include the .xlsm file in the commit, but vbaDeveloper The big issue I haven't quite resolved is when two people have edited the So much cleaner when you just work with code... |
Thanks for all this useful input.I think it makes sense to add option 2 as a feature to the VbaDeveloper addin.
(Unfortunately) we do commit excel binary files to version control. Simply because some workbooks are more than just VBA code. For example you may have text, data and formatting in a worksheet. Although it is possible to build your entire workbook programmaticaly in VBA code, this is usually quite a lot of effort to do. How do we deal with forms? We simply git ignore the .frx files. This way they don't show up as changed (although they may have) and we don't commit them. No information is lost, because the entire form is already part of the excel binary file, which we do commit. If you'd want to, you can simply export the .frx again from the original excel workbook. |
In the export process, Forms are exported as binary files (.frx). Since vbaDeveloper re-exports and overwrites and because of something in the file creation process(maybe a date stamp or some similar tag??), when putting the exported VBA form into version control it appears to have changed in every commit, regardless of whether the user actually made changes. This can lead to confusion in version control.
I see 3 choices:
Ignore, and adapt my Git workflow (i.e. just don't commit the unchanged files). This is slightly more manual, and also a slight training burden for my not-very-git-savy teammates.
Add a function to the vbaDeveloper to prompt whether to export forms and any other offending file types. Don't prompt if no offending file types would be exported.
Hunt down what the reason for the differing binary files and see if it is possible to exclude that component from the export.
Anyone else have opinions, or have a need for option 2 or 3 if I were to develop it? Anyone (particularly the project owner) opposed to option 2?
The text was updated successfully, but these errors were encountered: