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: Pádraig Brady
Subject: Re: [PATCH] maint: fix alphabetical order in .gitignore
Date: Wed, 02 Jan 2013 14:52:30 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

On 01/02/2013 02:17 PM, Eric Blake wrote:
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.

Yes I'll sed '/^!/d' before the compare,
and add a comment to both sort_patterns()
and the syntax check rule to avoid becoming out of sync.

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.

Sorry yes.
I always mail first.

thanks,
Pádraig.







reply via email to

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