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, 19:39 UTC
Message-ID
<5230C6E3.3080406@bracey.fi>
In-Reply-To
<20130911182444.GD4326@google.com>
On 11/09/2013 21:24, Jonathan Nieder wrote:
Show 36 quoted lines
> Kevin Bracey wrote:
>
>> 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
> [...]
>> 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."
>>
> [...]
>> 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.
> Thanks for this analysis.  Interesting.
>
> The rule (1) comes from v1.3.0-rc1~13^2~6: ...
>
> I think you're right that dropping the "don't follow off-graph
> treesame parents" rule would be a sensible change.  The usual point of
> the "follow the treesame parent" rule is to avoid drawing undue
> attention to merges of ancient history where some of the parents are
> side-branches with an old version of the files being tracked and did
> not actually change those files.  That rationale applies just as much
> for a merge on top of an UNINTERESTING rev as any other merge.

I agree about the rationale still applying - why not follow off-graph, unless you're doing --ancestry-path? (Fortunately ancestry_path already disables simplify_history). That makes more sense if you try to ignore the misleading comment. In a typical "v1..v3" range, the temporal limiting means that it's paths to the mainline that will tend to be marked UNINTERESTING, not to the topic branches...

But I can imagine going off graph it may previously have tripped up other parts of the code. It could be that this Git 1.3.0 rule ended up covering over some of the older merge hiding logic flakiness. Maybe it's no longer necessary. I'll do some experiments.

Now, one bit of news - I have just figured out why gitk is behaving differently. It transforms ".." before it reaches git.

To see the effect at the command line: "git log v1.8.3..v.1.8.4" hides the merge, but "git log ^v1.8.3 v1.8.4" shows it. Whoops. A new example of a dotty shorthand not being exactly equivalent.

In the ".." case the v1.8.3 tag gets peeled before being sent to add_rev_cmdline , and the "mark bottom commits" logic works. But in the "^" case, the v1.8.3 doesn't get peeled. Junio - any thoughts on the correct place to fix that? (And gitk actually does ^<tag-sha>, just to be odd, so that needs to be handled too). Should these things be peeled in revs->cmdline or not? We should be consistent.

Kevin
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 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.