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

[PATCH 0/1] Preserve topological ordering after merges

From
SGSergey Rudyshin via GitGitGadget <gitgitgadget@gmail.com>
Date
Jan 7, 2020, 10:30 UTC
Message-ID
<pull.514.git.1578393057.gitgitgadget@gmail.com>

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
-- 
gitgitgadget
Next: Sergey Rudyshin via GitGitGadget
Message 1 of 11 in “Preserve topological ordering after merges”
  1. 0/1 Preserve topological ordering after mergesSergey Rudyshin via GitGitGadget, Jan 7, 2020
  2. 1/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 followsSergey Rudyshin via GitGitGadget, Jan 7, 2020
  3. Johannes SchindelinJan 7, 2020
  4. Junio C HamanoJan 7, 2020
  5. Sergey RudyshinJan 8, 2020
  6. Derrick StoleeJan 7, 2020
  7. Sergey RudyshinJan 8, 2020
  8. Johannes SchindelinJan 7, 2020
  9. Sergey RudyshinJan 8, 2020
  10. Derrick StoleeJan 8, 2020
  11. Sergey RudyshinJan 8, 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.