Good file ignore list for SVN or GIT?

This is a discussion on Good file ignore list for SVN or GIT? within the Tech Board forums, part of the Community Boards category; Can anyone recommend a good list of file types for a GIT/SVN ignore list when working on a C Project? ...

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    8

    Good file ignore list for SVN or GIT?

    Can anyone recommend a good list of file types for a GIT/SVN ignore list when working on a C Project? I want to write a PECL extension for PHP and have been snooping around and found the following (from language agnostic - Best general SVN Ignore Pattern? - Stack Overflow) but was wondering if it was any good or not. Any help could be much appreciated.

    Code:
    *.o *.lo *.la #*# .*.rej *.rej
    .*~ *~ .#* .DS_Store thumbs.db
    Thumbs.db *.bak *.class *.exe *.dll
    *.mine *.obj *.ncb *.lib *.log
    *.idb *.pdb *.ilk *.msi* .res *.pch *.suo
    *.exp *.*~ *.~* ~*.* cvs  CVS .CVS .cvs
    release Release debug Debug
    ignore Ignore bin Bin obj  Obj
    *.csproj.user *.user
    *.generated.cs

  2. #2
    Registered User ledow's Avatar
    Join Date
    Dec 2011
    Posts
    435
    Personally, I wouldn't bother with any of that (but yeah, it works, why don't you just try it and make sure everything you want ignored/committed is ignored/committed rather than ask on a forum?).

    My solution would be to not clutter your development filesystem in the first place. Have your Makefiles (or whatever) store pre-compiled headers, objects files, debug files etc. in a separate folder that never gets committed (hinted at by the Debug/Release folders here) and then you save yourself a lot of hassle. Have one folder with "just code" (.c, .h, Makefile, etc.) and have everything else - even executables - generated in subfolders that aren't ever committed (either by svn:ignore, or by just them being outside the source-managed folder in the first place). Then there's no ignore list to manage, you know you can just delete the folder to get a clean compile, and you know that so long as you don't distribute the source folder you've not distributed any source (and thus don't have to "pick-and-choose" files that you can send other people.

    - Compiler warnings are like "Bridge Out Ahead" warnings. DON'T just ignore them.
    - A compiler error is something SO stupid that the compiler genuinely can't carry on with its job. A compiler warning is the compiler saying "Well, that's bloody stupid but if you WANT to ignore me..." and carrying on.
    - The best debugging tool in the world is a bunch of printf()'s for everything important around the bits you think might be wrong.

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    1,197
    I have to disagree with ledow. Especially when you are collaborating with people it is very easy that a Release folder or something similar gets added. And if the tools to make your life easier are available, you should definately use them.

    As far as the list, I think you have covered most of the normal things you might want to ignore in version control, but don't forget to tune it based on the project/environment you are working in at the moment.

  4. #4
    Registered User
    Join Date
    Apr 2011
    Posts
    8
    Quote Originally Posted by Shakti View Post
    I have to disagree with ledow. Especially when you are collaborating with people it is very easy that a Release folder or something similar gets added. And if the tools to make your life easier are available, you should definately use them.
    Although I'm really rusty at C programming, I've done enough coding to know that you don't really want extra stuff in your repository. This particular project is a PECL extension so there is a lot of baggage inherent in the file structure.

    I'm also wondering if there's any crash course on understanding what the various files types (*.lo, *la, *.dsp, etc.) are for?

    I'm so rusty

  5. #5
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,160
    This is only an issue if you already have a tree and you are checking it into source control for the first time. Normally, a project begins its life already in source control and as new files are created they are added to source control as that happens.

    Worst case, it'll only take you a couple of minutes to go through the tree and purge all the intermediates and temporary files. If the tree is really massive so that this task is unbearable, I have to wonder how such a huge tree got made without ever being placed into source control in the first place...

    No matter what, intermediates and temporaries absolutely should NOT be checked in.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  6. #6
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,383
    Quote Originally Posted by sneakyimp View Post
    Can anyone recommend a good list of file types for a GIT/SVN ignore list when working on a C Project?
    No. Because it will depend on your project files.

    The general rule is ignore directories first. This should help you avoid cluttering your list with unnecessary file extensions (if you ignore the obj directory, you won't need to ignore .obj files). Ignore files and files extensions on a case by case basis when you can't ignore the directory where they reside.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Console window waiting on cin.ignore() or cin.ignore(2)
    By The SharK in forum C++ Programming
    Replies: 3
    Last Post: 07-19-2006, 04:17 PM
  2. How do I ignore values from an input file
    By jaisch in forum C++ Programming
    Replies: 1
    Last Post: 10-23-2005, 04:08 PM
  3. linked list (good example)
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 01-30-2002, 11:12 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21