Lmms: Should we add IDE project files to .gitignore?

Created on 28 Jun 2019  路  11Comments  路  Source: LMMS/lmms

Question targets developers only. Issue opened because of #4977 .

I'd rather say this should go into your global gitignore. Otherwise, we could also add .o, .bak, ...

  • :heart: IDE project files should go into .gitignore
  • :eyes: IDE project files should go into your global .gitignore
  • :rocket: Other opinion, please specify
poll

Most helpful comment

Changing my vote too. I wasn't aware of .git/info/exclude, and so was against forcing LMMS's decision about project files onto users' global settings. In fact, the Git documentation recommends the use of .git/info/exclude exactly for this purpose:

Patterns which are specific to a particular repository but which do not need to be shared with other related repositories (e.g., auxiliary files that live inside the repository but are specific to one user鈥檚 workflow) should go into the $GIT_DIR/info/exclude file.

All 11 comments

Wait, there's a global gitignore, as in "these files will be ignored for all repos on this computer"? If so, then I'd close #4977 and do that instead.

On the Linuxes I used, it's ~/.config/git/ignore . Does that fit your purpose?

Yes that works fine, git allows you to create the file anywhere and set it with git config --global core.excludesfile <file>

We had that discussion at work today with someone who wanted to add IDE project files to some repos, so they did not want to add it into their global ignore.

Maybe one should use the global ignore only for files where it's absolutely clear that you would not add them into any repo (e.g. .o files)?

I found that .git/info/exclude also works.

I found that .git/info/exclude also works.

does it mean I should create this file in my local repo and use it like a gitignore ?

@SeleDreams I'm not completely sure what PhysSong means there (sorry!), but this is how you set up your own global .gitignore:

https://stackoverflow.com/questions/7335420

@JohannesLorenz I'll close this in a few days if I don't hear otherwise. I switched my vote as I apparently now disagree with past me.

Changing my vote too. I wasn't aware of .git/info/exclude, and so was against forcing LMMS's decision about project files onto users' global settings. In fact, the Git documentation recommends the use of .git/info/exclude exactly for this purpose:

Patterns which are specific to a particular repository but which do not need to be shared with other related repositories (e.g., auxiliary files that live inside the repository but are specific to one user鈥檚 workflow) should go into the $GIT_DIR/info/exclude file.

I'm OK with closing this, but just to understand it:

  • If you have files that should never be versioned in any repo at all (like .o, .pdf, .exe files), put those into your global gitignore (on linux ~/.config/git/ignore).
  • If a project wants to force their users to ignore a file type specific to their repo (e.g. .mmpz in our case if we would not have tests with those files, but not .o files which are not LMMS specific), they put it in their versioned .gitignore.
  • If you have files where you decide that they should be versioned in some repos, but not in other repos (e.g. you want to ignore IDE files only in some repos, but you are also IDE developer who sometimes need to put them under version control), you add them to the project specific .git/info/exclude.

Is that right?

@JohannesLorenz I'd say any files generated by a project's build process that should be ignored should go in the project's .gitignore, files generated by 3rd party stuff that isn't part of the project at all (like IDEs) and should never be included by any project go in global gitignore, and files generated by 3rd party stuff that you only want ignored for a certain repo go in .git/info/exclude.

Is that right?

Yes, that's my understanding at least. Obviously this is all just convention though.

Was this page helpful?
0 / 5 - 0 ratings