On 04/05/2011 02:19 PM, Bruce Korb wrote: >> What order-dependent sorting rules do you have, that would not already >> be covered by sinking ! lines to the bottom of the .gitignore file per >> the patch I just posted there? > > The order-that-I-put-them-in rule. In general, I think I understand > stuff better than a computer, so why am I being over-ruled?
I tend to like sorted files (if nothing else, the human brain is much
better at finding lines in a sorted file than a random one, just as
binary searching is more efficient than linear searching for a computer).
> The hypothetical and still somewhat concrete issue is the sequence:
>
> 1. ignore this file pattern
> 2. but don't ignore this pattern ('!' prefix)
> 3. but do ignore this specific file
>
> sinking to the bottom causes #2 to override #3, but I don't have that
> problem. It is theoretical until someone stubs their toe.
> For me, the difference is that when I want a particular order,
> I don't think that tools should go in and correct me. :)
You have a couple of valid points there - 1) yes, git ignore files
technically can have such complex relations where no amount of sort+sed
will avoid corrupting various line combinations into an incorrect mess;
2) anyone that has a project that relies on ignore rules hairy enough to
require manual layout has probably got other issues, so it's probably
not currently a bug in the wild and therefore not an immediate pressing
concern to completely ditch sorting once ! sinking is in place.
Hmm, this also points back to Gary Vaughan's ideas to modularize
bootstrap into something that can have per-project function overrides
(most projects would be okay with the default function that sorts with !
sinking, but the rare project that needs to ditch sorting could override
that function with an alternate one that just appends).
>
> That said, I'll leave it your call and only make the first patch.
Tell you what - let's compromise :)
I'll commit my patch now (it fixes a real bug for libvirt), and gladly
let you commit yours at any future date, if and when you actually need
it. Besides, while I like the automated sorting, I can maintain sorting
manually if automating it caused actual bugs, nor do I think that there
are that many occasions in the first place where running bootstrap has
actually added a line to my top-level .gitignore to even need re-sorting.
--
Eric Blake [email protected] +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
