On Fri, Jul 1, 2011 at 2:25 AM, Zane Bitter <zbitter(a)redhat.com> wrote:
On 30/06/11 06:15, Andrew Beekhof wrote:
>
> What's best practice with Git? A global .gitignore or one per directory?
> Both?
> I know CVS was per diretory and Mercurial uses a global one...
CVS/svn is per-directory, hg is global, git is per directory but
subdirectories inherit from their parents as well.
I wonder who dreamed that one up :-)
Personally, I like to limit the scope of each ignore to the minimum
required, and I prefer to e.g. add stuff to src/.gitignore rather than put
src/ paths in the root .gitignore. I'm not going to claim this as a "best
practice" because I don't believe in them[1] ;)
s/Best practice/Practice most likely to be comprehended by those that
maintain this after we're all gone/
Beekhof's first law: Given two functionally equivalent solutions,
choose the one that requires the least knowledge to be understood.
Note that we already had multiple .gitignore files in the project (e.g. I
did not create the src/.gitignore one, although it wasn't doing anything
useful any more).
Ok, go with that, but can you add a line at the top mentioning the
inheritance please?
cheers,
Zane.
[1]
http://www.satisfice.com/blog/archives/27
> On Wed, Jun 29, 2011 at 3:24 AM, Zane Bitter<zbitter(a)redhat.com> wrote:
>>
>> Signed-off-by: Zane Bitter<zbitter(a)redhat.com>
>> ---
>> .gitignore | 22 +++++++++-------------
>> src/.gitignore | 9 ++++++++-
>> src/lib/.gitignore | 1 +
>> 3 files changed, 18 insertions(+), 14 deletions(-)
>> create mode 100644 src/lib/.gitignore
>>
>> diff --git a/.gitignore b/.gitignore
>> index d9c0808..83e6e74 100644
>> --- a/.gitignore
>> +++ b/.gitignore
>> @@ -1,26 +1,22 @@
>> -
>> -*.o
>> *.patch
>> *.orig
>> *.rej
>> *.rpm
>> -*.tbz2
>> *~
>> *.cmake
>> Makefile
>> -src/config.h
>> -INSTALL
>> -src/matahari-host
>> -src/qmf/com
>> matahari*.tbz2
>> +matahari*.tgz
>> CMakeFiles
>> CMakeCache.txt
>> mock
>> -matahari-broker.init
>> +matahari.init
>> +matahari.sysconf
>> +matahari-broker
>> +matahari-broker.conf
>> matahari-broker.sysconf
>> -build
>> -build-win
>> -src/include/matahari.h
>> -src/matahari-*
>> -linux.build
>> +*.build
>> +*.check
>> +*.spec.sed
>> tags
>> +TAGS
>> diff --git a/src/.gitignore b/src/.gitignore
>> index 8ae8bbb..8b0df98 100644
>> --- a/src/.gitignore
>> +++ b/src/.gitignore
>> @@ -1 +1,8 @@
>> -CMakeFiles
>> +*.o
>> +config.h
>> +include/matahari.h
>> +qmf
>> +matahari-*
>> +*-dbus-glue.h
>> +*-dbus-properties.h
>> +org.matahariproject.*.xml
>> diff --git a/src/lib/.gitignore b/src/lib/.gitignore
>> new file mode 100644
>> index 0000000..8d97753
>> --- /dev/null
>> +++ b/src/lib/.gitignore
>> @@ -0,0 +1 @@
>> +*.so*
>>
>> _______________________________________________
>> Matahari mailing list
>> Matahari(a)lists.fedorahosted.org
>>
https://fedorahosted.org/mailman/listinfo/matahari
>>