bootstrap: remove the need for a sorted .gitignore
authorBernhard Voelker <mail@bernhard-voelker.de>
Sun, 20 Jan 2013 18:06:54 +0000 (18:06 +0000)
committerPádraig Brady <P@draigBrady.com>
Sat, 26 Jan 2013 02:20:19 +0000 (02:20 +0000)
commit0012ebc176b72505d01b547c91aff5a4e5feef5e
tree484a586fb4811d360064f32875cff2db4e87b1ee
parent03d71e383b0ec08c98b026e1c6ee0cbf79854574
bootstrap: remove the need for a sorted .gitignore

During bootstrap, files may be created which are already included
in .gitignore, but the test to add such a file relied on the
sort order.  Now, it just adds such a new entry and thus only
changes the file if the line count would change.

* bootstrap (insert_if_absent): Instead of comparing the
sorted new file with the original, the function compares the line
count, and only in case of a difference, the given file is changed.
Also ensure that the given ignore file does not already include
duplicate entries, as otherwise, the entry count would be innacurate.
(sort_patterns): Remove this now redundant function.
(gitignore_entries): A new function to return significant entries
from .gitignore.

Improved-by: Pádraig Brady
ChangeLog
build-aux/bootstrap