Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Git repository: ignore file  (Read 3065 times)

0 Members and 1 Guest are viewing this topic.

Klaim

  • Full Member
  • ***
  • Posts: 137
    • View Profile
Git repository: ignore file
« 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).

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Git repository: ignore file
« Reply #1 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 ;)
Laurent Gomila - SFML developer

Klaim

  • Full Member
  • ***
  • Posts: 137
    • View Profile
Re: Git repository: ignore file
« Reply #2 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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
AW: Git repository: ignore file
« Reply #3 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. :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: Git repository: ignore file
« Reply #4 on: April 08, 2013, 01:33:40 pm »
Modify .git/info/exclude to add local files to the ignore list.

Klaim

  • Full Member
  • ***
  • Posts: 137
    • View Profile
Re: Git repository: ignore file
« Reply #5 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

 

anything