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

Re: [PATCH 2/3] merge-recursive: untangle double meaning of o->call_depth

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 7, 2013, 18:37 UTC
Message-ID
<7v1u7a43or.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7e823a9faedf1980912628c3a3f083e26fb0c650.1373219466.git.trast@inf.ethz.ch>
Thomas Rast <trast@inf.ethz.ch> writes:
> o->call_depth has a double function: a nonzero call_depth means we
> want to construct virtual merge bases, but it also means we want to
> avoid touching the worktree.  Introduce a new flag o->no_worktree for
> the latter.

I do remember discussing this with you the other day, and while I do agree that we may not want to touch the working tree in the outermost merge (i.e. o->call_depth is zero) in some applications, I do not think of a situation where you _do_ want to touch working tree while performing the inner merge. I'd feel safer if the code said that "no matter what no-worktree option says, we won't touch the working tree if o->call_depth is not zero" clearly in some way, e.g.

	if (o->call_depth || o->in_index_merge)
        	return; /* leave without touching working tree */

In other words, I do not like the part of the code that pretends these two are independent options, when what we really want is to have two modes for the outermost (o->call_depth == 0) case.

Previous: Thomas RastNext: Thomas Rast
Message 4 of 15 in “merge -Xindex-only”
  1. 0/3 merge -Xindex-onlyThomas Rast, Jul 7, 2013
  2. 1/3 merge-recursive: remove dead conditional in update_stages()Thomas Rast, Jul 7, 2013
  3. 2/3 merge-recursive: untangle double meaning of o->call_depthThomas Rast, Jul 7, 2013
  4. Junio C HamanoJul 7, 2013
  5. 3/3 merge-recursive: -Xindex-only to leave worktree unchangedThomas Rast, Jul 7, 2013
  6. Michael HaggertyJul 8, 2013
  7. Thomas RastJul 8, 2013
  8. Michael HaggertyJul 9, 2013
  9. Thomas RastJul 9, 2013
  10. Michael HaggertyJul 9, 2013
  11. Thomas RastJul 9, 2013
  12. Thomas RastOct 26, 2013
  13. 1/3 merge-recursive: remove dead conditional in update_stages()Thomas Rast, Oct 26, 2013
  14. 2/3 merge-recursive: internal flag to avoid touching the worktreeThomas Rast, Oct 26, 2013
  15. 3/3 merge-recursive: -Xindex-only to leave worktree unchangedThomas Rast, Oct 26, 2013

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.