Re: [PATCH] Add tests to demonstrate update-index bug with core.symlinks/core.filemode
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:49:52
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.