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: Bernhard Voelker
Subject: Re: [PATCH] maint: fix alphabetical order in .gitignore
Date: Wed, 02 Jan 2013 14:09:06 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0


On 01/02/2013 01:39 PM, Pádraig Brady wrote:

> What's probably happening is that something is
> auto inserting into .gitignore and thus resorting it.
> I see insert_vc_ignore() in bootstrap for example.

That must be it. ;-)

> If we added a new syntax-check to catch this issue,
> then we'd not run into it again.

Here comes a new patch with the new rule.
(I even used "sort -u" instead of a simple "sort"
to avoid duplicate entries.)

Thanks and have a nice day,
Berny

>From 4e475a01304fabf2a361a5d11328683615e7b228 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <address@hidden>
Date: Wed, 2 Jan 2013 14:06:20 +0100
Subject: [PATCH] maint: fix alphabetical order in .gitignore
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Since commit v8.20-67-g0f525b6, .gitignore sometimes
showed up as changed because the entries "*.gcda" and
"*.gcno" had not been in alphabetical order.

* .gitignore: Exchange the entries "*.gcda" and "*.gcno".
* cfg.mk (sc_prohibit_unsorted_gitignore): Add new rule to
enforce the alphabetical order in .gitignore.

Improved-by: Pádraig Brady
---
 .gitignore |    2 +-
 cfg.mk     |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/.gitignore b/.gitignore
index 67f428c..f0d6d87 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,8 @@
 *.I[12]
 *.[EIOX]
 *.bak
-*.gcno
 *.gcda
+*.gcno
 *.o
 */.deps/
 *~
diff --git a/cfg.mk b/cfg.mk
index fbc64b4..a99e8b6 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -102,6 +102,14 @@ sc_root_tests:
        rm -f $$t1 $$t2;                                                \
        exit $$st

+# 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="\\";                                                       \
-- 
1.7.7




reply via email to

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