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

Re: breakage in revision traversal with pathspec

From
Kevin Bracey <kevin@bracey.fi>
Date
Sep 11, 2013, 17:49 UTC
Message-ID
<5230AD23.2050009@bracey.fi>
In-Reply-To
<xmqq38pcwc21.fsf@gitster.dls.corp.google.com>
On 11/09/2013 01:23, Junio C Hamano wrote:
Show 17 quoted lines
> Kevin Bracey <kevin@bracey.fi> writes:
>
>> On 10/09/2013 20:19, Junio C Hamano wrote:
>>> This command
>>>
>>>       $ git log v1.8.3.1..v1.8.4 -- git-cvsserver.perl
>>>
>>> reports that a merge 766f0f8ef7 (which did not touch the specified
>>> path at all) touches it.
>>>
>>> Bisecting points at d0af663e (revision.c: Make --full-history
>>> consider more merges, 2013-05-16).
>>>
>> That merge appearing *with* --full-history would seem like correct
>> behaviour to me. Or at least it's what I intended.
> ... But it shouldn't
> appear if the user does not ask for "--full-history".

Well, there is a functioning semi-work-around for now: avoid difficult non-linear questions like "v1.8.3.1..v1.8.4". A question like "v1.8.3..v1.8.4" is a lot easier to visualise, and it does already omit the merge.

On reflection I'm not sure what we should for the "simple history" view of v1.8.3.1..v1.8.4. We're not rewriting parents, so we don't get a chance to reconsider the merge as being zero-parent, and we do have this little section of graph to traverse at the bottom:

           1.8.3
             o----x----x----x----x---x---     (x = included, o = 
excluded, *=!treesame)
                 /
                /*
   o--x--x--x--x

In effect, we do have a linear section of history to follow, and the file does change in the middle of that line. It may be quite hard to come up with a solid rule to hide the merge that doesn't go wrong somewhere else.

The current rules for this are
1) if identical to any on-graph parent, follow that one, and rewrite the 
merge as a non-merge. We currently do not follow to an identical 
off-graph parent. This long-standing comment in try_to_simplify_commit 
applies: "Even if a merge with an uninteresting side branch brought the 
entire change we are interested in, we do not want to lose the other 
branches of this merge, so we just keep going." For this query, the 
mainline link to 1.8.3 is the "uninteresting side branch"! If you do 
specify v1.8.3..v1.8.4, then v1.8.3 becomes "on-graph" thanks to other 
new rules, and this rule does kick in, hiding the merge.
2) If rule 1 doesn't activate, and it remains as a merge, hide it if 
treesame to all on-graph parents. Previously this rule was "hide if 
treesame to any parent", and so that would have hidden the merge.

Now, when I changed rule 2, I did not think this would affect the default log. See my commit message:

     "Now redefine a commit's TREESAME flag to be true only if a commit is
     TREESAME to _all_ of its [later: on-graph] parent. This doesn't 
affect ... the default
     simplify_history behaviour (because partially TREESAME merges are 
turned
     into normal commits)..."

Whoops - partially TREESAME merges are not always turned into normal commits.

Maybe the fix is to define TREESAME differently for simplify_history - to use the old definition of "identical to any parent" in that case. I'm not sure that's right though.

I currently feel instinctively more disposed to dropping the older "don't follow off-graph identical parents" rule. Let the default history go straight to v1.8.3 even though it goes off the graph, stopping us traversing the topic branch.

Kevin
Previous: Junio C HamanoNext: Jonathan Nieder
Message 4 of 14 in “breakage in revision traversal with pathspec”
  1. Junio C HamanoSep 10, 2013
  2. Kevin BraceySep 10, 2013
  3. Junio C HamanoSep 10, 2013
  4. Kevin BraceySep 11, 2013
  5. Jonathan NiederSep 11, 2013
  6. Junio C HamanoSep 11, 2013
  7. Kevin BraceySep 11, 2013
  8. Junio C HamanoSep 11, 2013
  9. Junio C HamanoSep 19, 2013
  10. Jeff KingSep 20, 2013
  11. Junio C HamanoSep 20, 2013
  12. Jeff KingSep 20, 2013
  13. Junio C HamanoSep 20, 2013
  14. Jeff KingSep 25, 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.