Skip to content

Preserve topological ordering after merges

Sergey Rudyshin via GitGitGadget git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1Preserve topological ordering after merges This modifies the algorithm of topopological ordering. The problem with the current algoritm is that it displays the graph below as followsDocumentation/git-rev-list.txt Documentation/rev-list-options.txt commit.c +7 more+214 -1525 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/1] Preserve topological ordering after merges

This modifies the algoritm of topopological ordering. The problem with the current algoritm is that it displays the graph below as following

* E

|\
| * D
| |\
| |/
|/|

* | C
| * B
|/
* A

commit B is placed between A and C, which is wrong because E stays that D and B comes after C

the only correct solution here is

* E

|\
| * D
| |\
| |/
|/|
| * B

* | C
|/
* A

while it seems that it contradicts to D staiting that C shoud be between D and B The new algorithm solves this issue

Here is an example: walk to to the root via "first" parents go E -> C -> A print A because it has no parents step back to C print C because it has no other parents then step back to E go D -> B -> A do not print A becase A is already printed step back to B print B so on

This change makes option "--topo-order" obsolete, because for a single commit there is only one way to order parents. "--date-order" and "--author-date-order" are preserved and make sence only for the case when multiple commits are given to be able to sort those commits.

Sergey Rudyshin (1):
Preserve topological ordering after merges This modifies the algorithm
of topopological ordering. The problem with the current algoritm is that it displays the graph below as follows

 Documentation/git-rev-list.txt             |   4 +-
 Documentation/rev-list-options.txt         |  41 +++---
 commit.c                                   | 149 ++++++++++++++-------
 commit.h                                   |   4 +-
 t/t4202-log.sh                             |  15 +--
 t/t4215-log-skewed-merges.sh               |  44 +++---
 t/t6003-rev-list-topo-order.sh             |  54 ++++----
 t/t6012-rev-list-simplify.sh               |   8 +-
 t/t6016-rev-list-graph-simplify-history.sh |  41 +++---
 t/t6600-test-reach.sh                      |   6 +-
 10 files changed, 214 insertions(+), 152 deletions(-)

base-commit: 8679ef24ed64018bb62170c43ce73e0261c0600a
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-514%2FSergeyRudyshin%2Ftopo_order_fix-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-514/SergeyRudyshin/topo_order_fix-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/514

Signature · 1 line
gitgitgadget