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

[PATCH 0/2] Option to modify revision mark for root commits

From
KMKyle Marek <kmarek@pdinc.us>
Date
Jan 17, 2021, 11:03 UTC
Message-ID
<20210117110337.429994-1-kmarek@pdinc.us>
In-Reply-To
<196101d6eab6$20714550$6153cff0$@pdinc.us>

This patch series allows --show-linear-break to be used with --graph, allowing for the revision mark to be changed for root commits.

Feel free to squash away PATCH 1, or maybe even discard PATCH 2.
Jason: tested against Cygwin x86_64/release/git/git-2.30.0-1-src.tar.xz
Note: PATCH 2 revision.c:2410 makes a second copy of optarg. This may
not be necessary.
Background:

The use case is --graph --oneline with unrelated histories. For example, in a hypothetical repository with an orphaned "prebuilt" branch containing builds of the master branch, the history may look like:

kmarek@kyle-ppc64le /tmp/somerepo
$ git log --graph --all --oneline
* 02190b6 (prebuilt) add aarch64
* 7b873f6 add x86_64
* 26cc783 add ppc64le
* 5b7186e (HEAD -> master) add Makefile
* ea69093 implement cmdline parsing
* a65df8a add main.c
* 7727eb3 Initial commit

At first sight, the above log implies that 26cc783's parent is 5b7186e, or that master is an ancestor to prebuilt, but 26cc783 is the start of a new history:

kmarek@kyle-ppc64le /tmp/somerepo
$ git log --graph --oneline master
* 5b7186e (HEAD -> master) add Makefile
* ea69093 implement cmdline parsing
* a65df8a add main.c
* 7727eb3 Initial commit
kmarek@kyle-ppc64le /tmp/somerepo
$ git log --graph --oneline prebuilt
* 02190b6 (prebuilt) add aarch64
* 7b873f6 add x86_64
* 26cc783 add ppc64le
To identify the start of a new history:
kmarek@kyle-ppc64le /tmp/somerepo
$ git log --graph --all --oneline --show-linear-break
* 02190b6 (prebuilt) add aarch64
* 7b873f6 add x86_64
# 26cc783 add ppc64le
* 5b7186e (HEAD -> master) add Makefile
* ea69093 implement cmdline parsing
* a65df8a add main.c
# 7727eb3 Initial commit
kmarek@kyle-ppc64le /tmp/somerepo
$ git log --graph --all --oneline --show-linear-break=I
* 02190b6 (prebuilt) add aarch64
* 7b873f6 add x86_64
I 26cc783 add ppc64le
* 5b7186e (HEAD -> master) add Makefile
* ea69093 implement cmdline parsing
* a65df8a add main.c
I 7727eb3 Initial commit
Kyle Marek (2):
  revision: Denote root commits with '#'
  revision: implement --show-linear-break for --graph
 Documentation/rev-list-options.txt |  7 +++++++
 log-tree.c                         |  2 +-
 revision.c                         | 10 ++++++----
 revision.h                         |  1 +
 4 files changed, 15 insertions(+), 5 deletions(-)
-- 
2.29.2
Previous: Jason PyeronNext: Kyle Marek
Message 4 of 29 in “add a blank line when a commit has no parent in log output?”
  1. Jason PyeronJan 14, 2021
  2. Philippe BlainJan 14, 2021
  3. Jason PyeronJan 14, 2021
  4. 0/2 Option to modify revision mark for root commitsKyle Marek, Jan 17, 2021
  5. 1/2 revision: Denote root commits with '#'Kyle Marek, Jan 17, 2021
  6. Junio C HamanoJan 17, 2021
  7. Kyle MarekJan 18, 2021
  8. Junio C HamanoJan 18, 2021
  9. Junio C HamanoJan 18, 2021
  10. Kyle MarekJan 19, 2021
  11. Junio C HamanoJan 19, 2021
  12. Kyle MarekJan 20, 2021
  13. Junio C HamanoJan 20, 2021
  14. Jason PyeronJan 20, 2021
  15. Junio C HamanoJan 20, 2021
  16. Jason PyeronJan 20, 2021
  17. Junio C HamanoJan 23, 2021
  18. Jason PyeronJan 23, 2021
  19. Junio C HamanoJan 23, 2021
  20. Jason PyeronJan 24, 2021
  21. Junio C HamanoJan 25, 2021
  22. Junio C HamanoJan 17, 2021
  23. 2/2 revision: implement --show-linear-break for --graphKyle Marek, Jan 17, 2021
  24. Junio C HamanoJan 17, 2021
  25. Junio C HamanoJan 18, 2021
  26. Kyle MarekJan 18, 2021
  27. Junio C HamanoJan 18, 2021
  28. Kyle MarekJan 19, 2021
  29. Junio C HamanoJan 15, 2021

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.