So the questions are:
Is it possible to automatically create this file file in each new folder created by xojo?
Is it possible to handle the create new folder event by xojo script and get location to this folder?
Git really is a wonderful source control system but it’s true, it doesn’t see the world the same way as Xojo.
Git doesn’t care about folders. It doesn’t version them in any way, only the files within them.
So if there’s a file inside a folder that you’ve allowed Git to track, it will create the folder (and any others containing it, if necessary) when that file is recovered into your active directory. If there was no file in the folder to track, the folder doesn’t get recreated.
Interestingly, it’s not just when you create an empty folder in Xojo that it occurs. If you create a folder to hold a bunch of project externals like sounds, images, text files, and there are no items in the project folder that create an actual file on desk, then you’ll also get an empty folder on disk.
I’ve found a couple of work arounds. I either store additional project items in folders or I store a tiny 1-byte text file I call “folder holder.txt” in the folder (outside of the IDE). Then there’s no issue.
It’s one of several changes I’d like to see made to Xojo to help accommodate Git better, including automatically loading items on disk into projects. When sharing code libraries through subModules, new files don’t get integrated. It would be a nice option to have…
[quote=246980:@Kirill Pekarov]there is .gitkeep exactly for this.
So the questions are:
Is it possible to automatically create this file file in each new folder created by xojo?
Is it possible to handle the create new folder event by xojo script and get location to this folder?[/quote]
The problem is the IDE would need the know to do this on save. When you select “Xojo Project” it doesn’t create a git or svn specific project. It is generic. So to have the IDE create git-specific assets, when I may use svn, would just be weird and unwanted.
If version control saving was built into the IDE, I’m sure it would do this automatically. But for now, the IDE has no way to know your intentions.