Re: [PATCH 2/2] Make Git respect changes to .gitattributes during checkout.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 19, 2009, 21:06 UTC
- Message-ID
- <7v8wn18bo2.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <49C267E3.1020205@nokia.com>
Kristian Amlie <kristian.amlie@nokia.com> writes:
Show 12 quoted lines
> ext Junio C Hamano wrote: > ... >> For example, you may notice that, after making a clean checkout, one path >> has a wrong attribute assigned to it, and may try to correct it. But how? >> >> $ edit .gitattributes ;# mark foo.dat as binary >> $ rm foo.dat >> $ git checkout foo.dat ;# make sure the new settings is correct??? > > As far as I can see, this works without any modifications to the patch. > Is that maybe because git_attr_set_direction() is not called if you use > that form of checkout?
But that in itself can be seen as a bug, right? In another use case, suppose you botched your .gitattributes in HEAD version and noticed that foo.dat is checked out with a wrong attribute. You try to fix it like this:
$ git reset HEAD^ .gitattributes
$ rm foo.dat
$ git checkout foo.datIf you do not flip the direction, the one from the work tree is used which is not what you want. If you do, then you break the other use case.
Either way, you cannot win.
In any case, I think I already queued the patch in 'pu' but without documentation updates nor additional tests, so no need to include the patch itself when you send in an update.