Except that this would not work, just take that example (for the sake
of conciseness I put lines as members of a set):
Common ancestor content: (bar, foo, quux)
Left child: (bar, baz, foo, quux)
Right child: (bar, quux)
This one is a conflict, and if you apply your method, the merge always
"works" (as in has no cases where it fails) and would yield a result
like:
(bar, baz, foo, quux) whereas it's probably (bar, baz, quux) that
would be the proper one (aka left branch added a new ignore `baz` and
the right one removed it).
The proper way for gitignore is probably to work on the sets
operations, like diff does with lines, but without taking ordering into
account. What gets harder is when your lists are:
Ancestor: (aa*, aaa, bbb)
Left child: (aa*, bbb) <-- remove aaa because aa* covers it
Right child: (aaa, aabcd, bbb, cc*) <-- remove aa* and be explicit
The proper result is probably: (aaa, aabcd, bbb, cc*) but is in fact a
case of conflict, because the "left" child could have used the fact that
aa* was present and hide say a aaXXX that the right child did not had,
and the merge would be wrong.
Of course, .gitignore aren't _that_ important and if you ignore one
less file, or one too many, git will continue to behave properly, but
well, merge implementations aren't _that_ trivial.