SFML community forums

General => General discussions => Topic started by: Klaim on April 08, 2013, 11:41:50 am

Title: Git repository: ignore file
Post by: Klaim on April 08, 2013, 11:41:50 am
Is there a specific reason why there is no ignore file into the repository?

It would help to have one to avoid accidental commit of files generated by CMake (project files too).
Title: Re: Git repository: ignore file
Post by: Laurent on April 08, 2013, 11:59:50 am
I never put anything in the source tree, I make all my builds outside. No chance of accident ;)
Title: Re: Git repository: ignore file
Post by: Klaim on April 08, 2013, 12:12:14 pm
I see.

I'm not sure I can do that with all my projects (because of script files).
I tried that before but hit a problem at some point. I Don't remember which one though.

Will check if I can find it again. For working on SFML indeed I'll use this solution.
Title: AW: Git repository: ignore file
Post by: eXpl0it3r on April 08, 2013, 12:42:59 pm
.gitingore is more of a lazy ones way out. If you work with SFML you should always know what you've added and tripple check before doing any commits. ;)

Besides that you can add stuff to your global gitignore list.

I personally always run CMake within a separated build/ directory to prevent CMake cluttering, thus it's very easy to look out not to add the build/ dir. :)
Title: Re: Git repository: ignore file
Post by: Tank on April 08, 2013, 01:33:40 pm
Modify .git/info/exclude to add local files to the ignore list.
Title: Re: Git repository: ignore file
Post by: Klaim on May 22, 2013, 12:11:07 pm
Just a quick note that is not an argument but just raw information:
I just remembered why I don't like to have the generated files outside of the source repo directory.
It is indeed not a problem when you're working on something like SFML where most files are already there, adding files is rare.

I have some projects where I add new files almost each day. I'm using visual studio to write the code, so each time I want to create a new file I have to first create the file, then add it to CMake.
By reflex, I will right click in the project file tree into VS and add a new file, say a header.
VS will suggest a directory by default which is the directory where the project file is. So if it is generated by CMake, by default it will be in the generated directories, not in the source directories.
Unfortunately it is not obvious when I do this because I'm so used to just have to create the file and it will be in the right directory that I tend to forget to check where the directory the new file will be created is.

Also, it becomes worse when I'm working on a library which have to have headers separated in an include directory (which can be fixed by some scripting but...)

Any way, this is a minor nuisance because you just have to be more attentive of how you create the file, OR you just create a text file outside VS and run CMake and you're ready.
I tend to believe it's the typical minor details that annoys regularly and can make a developer very angry after some months but it's just a personal belief. I tend to work on removing anything that gets between the developer and the coding because it annoys me too and I just want to work on theproject instead of having to take care on some minimal matters.

Now I'm creating files outside VS. It works whatever IDE you work with.  ;D