git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Stefan HallerNext: Jakub Narebski
Message 4 of 6 in “git-update-index loses executable bit for unmerged files when core.filemode is false”
  1. Stefan HallerOct 22, 2010
  2. Add tests to demonstrate update-index bug with core.symlinks/core.filemodeStefan Haller, Oct 24, 2010
  3. Stefan HallerOct 24, 2010
  4. Junio C HamanoOct 25, 2010
  5. Jakub NarebskiOct 24, 2010
  6. Stefan HallerOct 25, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.