Re: [PATCH] Add tests to demonstrate update-index bug with core.symlinks/core.filemode
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 25, 2010, 07:34 UTC
- Message-ID
- <7vtykaiv4b.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1jqvvxl.1e5c93nipc126M%lists@haller-berlin.de>
lists@haller-berlin.de (Stefan Haller) writes:
> OK, so I found commit 2031427 (git add: respect core.filemode with > unmerged entries), and the corresponding email thread ...
I haven't had a chance to take a look at your issue with update-index, but the patch you quoted here was the first thing that came to my mind, and my gut feeling is that the same fix (or at least a fix in the same spirit) is appropriate for update-index.
Also I agree with you in that we should attempt the three-way merge of mode bits (not just in update-index but also in add) when the user tries to add contents from the working tree that does not have trustworthy executable bit.
1. If stages 2 and 3 have the same executable bits, we can take that
result they agree upon, without any warning; 2. If stages 2 and 3 are different, and if there is stage 1, we should
take the one that is different from stage 1; We _might_ want to warn
in this case, but I am not sure. 3. If there is no stage 1 present but stages 2 and 3 have different bits,
we should take the bit from stage 2 (for the sake of backward
compatibility), but I think we should warn the user that we did so; 4. If only one of stages 2 or 3 are present, we should take the bit from
the one that exists (again for the sake of backward compatibility),
but we should warn in this case as well, I think.