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

[RFC PATCH 0/1] Add lines to `git log --graph` to separate connected regions

From
Lê Duy Quang <leduyquang753@gmail.com>
Date
Apr 7, 2024, 05:10 UTC
Message-ID
<20240407051031.6018-1-leduyquang753@gmail.com>

`git log --graph`, when invoked with multiple starting revisions and some exclusions which cut the commit graph, may give a disconnected graph. In other words, the resulting graph has more than one separate connected regions. The command currently prints the connected regions on top of each other without any separation.

This leads to a problem. Say there are two connected regions, each having two commits, the graph would look like this:

* a2
* a1
* b2
* b1

which may lead to a misunderstanding that these four commits belong to the same timeline, i.e. b2 is a parent of a1.

This patchset adds a separator line between each pair of connected regions to clarify that they are not actually connected:

* a2
* a1
---
* b2
* b1
Lê Duy Quang (1):
  Add separator lines into `git log --graph`.
 graph.c                                |  55 +++++++++++-
 t/t4218-log-graph-connected-regions.sh | 119 +++++++++++++++++++++++++
 2 files changed, 170 insertions(+), 4 deletions(-)
 create mode 100755 t/t4218-log-graph-connected-regions.sh
base-commit: 19981daefd7c147444462739375462b49412ce33
-- 
2.44.0
Next: Lê Duy Quang
Message 1 of 15 in “Add lines to `git log --graph` to separate connected regions”
  1. 0/1 Add lines to `git log --graph` to separate connected regionsLê Duy Quang, Apr 7, 2024
  2. 1/1 Add separator lines into `git log --graph`.Lê Duy Quang, Apr 7, 2024
  3. Eric SunshineApr 7, 2024
  4. Eric SunshineApr 7, 2024
  5. Quang Lê DuyApr 7, 2024
  6. Dragan SimicApr 7, 2024
  7. Quang Lê DuyApr 7, 2024
  8. Eric SunshineApr 7, 2024
  9. Eric SunshineApr 7, 2024
  10. Junio C HamanoApr 7, 2024
  11. Quang Lê DuyApr 7, 2024
  12. Dragan SimicApr 7, 2024
  13. Quang Lê DuyApr 7, 2024
  14. Dragan SimicApr 7, 2024
  15. Junio C HamanoApr 8, 2024

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.