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

Re: [PATCH] revision: --include-diversions adds helpful merges

From
Jeff King <peff@peff.net>
Date
Apr 8, 2020, 18:48 UTC
Message-ID
<20200408184843.GA1963695@coredump.intra.peff.net>
In-Reply-To
<pull.599.git.1586308923544.gitgitgadget@gmail.com>
On Wed, Apr 08, 2020 at 01:22:03AM +0000, Derrick Stolee via GitGitGadget wrote:
Show 9 quoted lines
> The default file history simplification of "git log -- <path>" or
> "git rev-list -- <path>" focuses on providing the smallest set of
> commits that first contributed a change. The revision walk greatly
> restricts the set of walked commits by visiting only the first
> TREESAME parent of a merge commit, when one exists. This means
> that portions of the commit-graph are not walked, which can be a
> performance benefit, but can also "hide" commits that added changes
> but were ignored by a merge resolution.
> [...]
Thanks for a really great description of the problem.
Playing around with the patch, I found one curiosity. Try this:
  git log --graph --oneline origin -- GIT-VERSION-GEN >old
  git log --graph --oneline --include-diversions \
                            origin -- GIT-VERSION-GEN >new
  diff -u old new
The first hunk has:
  @@ -70,6 +70,7 @@
   * 20769079d2 Git 2.12-rc2
   * 5588dbffbd Git 2.12-rc1
   * 6e3a7b3398 Git 2.12-rc0
  +* 0a45050a14 Merge branch 'rj/git-version-gen-do-not-force-abbrev'
   * a7659747c2 GIT-VERSION-GEN: do not force abbreviation length used by 'describe'
   * 8d7a455ed5 Start post 2.11 cycle
   * 454cb6bd52 Git 2.11

which makes sense. That merge brought in a7659747c2, and the other side hadn't touched it. But I can't tell from the output how the two are related. Nor can I just add "-p" to the invocation; after we've simplified, it has only a single parent, but it's TREESAME to that parent. So it has no diff.

I actually think the most descriptive output here would be something like:

  * 6e3a7b3398 Git 2.12-rc0
  * 0a45050a14 Merge branch 'rj/git-version-gen-do-not-force-abbrev'
  |\
  | * a7659747c2 GIT-VERSION-GEN: do not force abbreviation length used by 'describe'
  |/
  * Start post 2.11 cycle

I.e., leaving both parents intact for a "diversion" merge. But maybe that would have secondary effects in other places.

-Peff
Previous: brian m. carlsonNext: Derrick Stolee via GitGitGadget
Message 19 of 23 in “revision: --include-diversions adds helpful merges”
  1. revision: --include-diversions adds helpful mergesDerrick Stolee via GitGitGadget, Apr 8, 2020
  2. Junio C HamanoApr 8, 2020
  3. Derrick StoleeApr 8, 2020
  4. Derrick StoleeApr 8, 2020
  5. Junio C HamanoApr 8, 2020
  6. Jeff KingApr 8, 2020
  7. Derrick StoleeApr 8, 2020
  8. Junio C HamanoApr 8, 2020
  9. Derrick StoleeApr 8, 2020
  10. Junio C HamanoApr 9, 2020
  11. Derrick StoleeApr 9, 2020
  12. Philip OakleyApr 9, 2020
  13. Junio C HamanoApr 9, 2020
  14. Derrick StoleeApr 9, 2020
  15. Jeff KingApr 9, 2020
  16. Junio C HamanoApr 9, 2020
  17. Jeff KingApr 9, 2020
  18. brian m. carlsonApr 8, 2020
  19. Jeff KingApr 8, 2020
  20. revision: --include-diversions adds helpful mergesDerrick Stolee via GitGitGadget, Apr 9, 2020
  21. revision: --show-pulls adds helpful mergesDerrick Stolee via GitGitGadget, Apr 10, 2020
  22. Junio C HamanoApr 10, 2020
  23. Derrick StoleeApr 10, 2020

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.