Skip to content

RFC Add lines to `git log --graph` to separate connected regions

Lê Duy Quang git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest1 patch 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1Add separator lines into `git log --graph`.graph.c t/t4218-log-graph-connected-regions.sh+170 -46 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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

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

Signature · 1 line
2.44.0