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

Re: [PATCH] git add: respect core.filemode even with unmerged entriesin the index

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 29, 2007, 10:20 UTC
Message-ID
<7v3b0bf4ea.fsf@assigned-by-dhcp.pobox.com>
In-Reply-To
<Pine.LNX.4.64.0706291106190.4438@racer.site>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 8 quoted lines
> On Fri, 29 Jun 2007, Johannes Sixt wrote:
>
>> However, if only two stages are present, the file mode is still taken 
>> from the file instead of from the index. As that easy to solve (at least 
>> for the unambiguous case)?
>
> It might be related to the bug Junio found, i.e. that I assumed stage 1 to 
> be "ours".

Actually it is because (-1-pos) and (1-pos) are two apart. By starting to scan from (1-pos), you are jumping directly to either the next path (in which case you do not pick it up), or "their" version (i.e. stage #3) iff there are three stages for the path in question.

I am all for refactoring the funny "pick up an existing entry at any stage, but favor 0 then 2 then 1 and finally 3" into a separate function. It makes sense, although I do not offhand know of a place that we can immediately reuse it (logically, diff-files ought to do that, but I haven't checked).

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 17 of 26 in “most commonly used git commands?”
  1. Michael S. TsirkinJun 25, 2007
  2. Junio C HamanoJun 25, 2007
  3. Michael S. TsirkinJun 25, 2007
  4. Junio C HamanoJun 25, 2007
  5. Martin LanghoffJun 28, 2007
  6. Josh TriplettJun 28, 2007
  7. Johannes SchindelinJun 25, 2007
  8. Alex RiesenJun 28, 2007
  9. Johannes SchindelinJun 28, 2007
  10. Johannes SixtJun 28, 2007
  11. Johannes SchindelinJun 28, 2007
  12. Johannes SixtJun 28, 2007
  13. Johannes SixtJun 28, 2007
  14. git add: respect core.filemode even with unmerged entries in the indexJohannes Schindelin, Jun 28, 2007
  15. Johannes SixtJun 29, 2007
  16. Johannes SchindelinJun 29, 2007
  17. Junio C HamanoJun 29, 2007
  18. git add: respect core.filemode with unmerged entriesJohannes Schindelin, Jun 29, 2007
  19. Junio C HamanoJun 29, 2007
  20. Johannes SchindelinJun 29, 2007
  21. Alex RiesenJun 30, 2007
  22. Johannes SchindelinJun 30, 2007
  23. Alex RiesenJun 30, 2007
  24. Jan HudecJul 1, 2007
  25. Alex RiesenJul 1, 2007
  26. Josh TriplettJun 28, 2007

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.