coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] maint: fix alphabetical order in .gitignore


From: Eric Blake
Subject: Re: [PATCH] maint: fix alphabetical order in .gitignore
Date: Wed, 02 Jan 2013 07:17:05 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 01/02/2013 06:15 AM, Pádraig Brady wrote:

>> +# Ensure that .gitignore is sorted alphabetically.
>> +sc_prohibit_unsorted_gitignore:
>> +    @t1=.gitignore; t2=.gitignore.sorted;                \
>> +    LANG=C sort -u < $$t1 > $$t2;                    \
>> +    st=0; diff -u $$t1 $$t2 || st=1;                \
>> +    rm -f $$t2;                            \
>> +    exit $$st
>> +
>>   # Ensure that all version-controlled test cases are listed in
>> $(all_tests).
>>   sc_tests_list_consistency:
>>       @bs="\\";                            \
>>
> 
> The part above is probably best in gnulib/top/maint.mk
> since that's where the sorted insertion is coming from.

No.  .gitignore syntax has situations where it must NOT be sorted, and
adding this as a syntax check rule will prevent useful situations where
unsorted files make sense.

For example, in libvirt, we have the following in .gitignore:

...
/po/*
...
!/po/*.po
!/po/POTFILES.in
!/po/libvirt.pot

since libvirt likes to keep the .po files checked into git, but doesn't
want to explicitly enumerate up whatever cruft of the day that different
versions of gettext happen to also stick in that directory.  But sorting
this directory would put the override inclusions _before_ the blanket
exclusion, and since git ignores files based on the _last_ rule present,
rather than the first, sorting would break this usage.

> Note LC_ALL is set to C in maint.mk already.
> I'll push a patch in your name to gnulib soon.

Please don't, at least not without more discussion.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]