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.