git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Sergey Rudyshin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Sergey Rudyshin <540555@gmail.com>, Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 0/1] Preserve topological ordering after merges
Date: Tue, 07 Jan 2020 10:30:56 +0000	[thread overview]
Message-ID: <pull.514.git.1578393057.gitgitgadget@gmail.com> (raw)

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

             reply	other threads:[~2020-01-07 10:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-07 10:30 Sergey Rudyshin via GitGitGadget [this message]
2020-01-07 10:30 ` [PATCH 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 follows Sergey Rudyshin via GitGitGadget
2020-01-07 12:08   ` Johannes Schindelin
2020-01-07 17:01     ` Junio C Hamano
2020-01-08  7:51     ` Sergey Rudyshin
2020-01-07 12:14   ` Derrick Stolee
2020-01-08 15:11     ` Sergey Rudyshin
2020-01-07 12:11 ` [PATCH 0/1] Preserve topological ordering after merges Johannes Schindelin
2020-01-08 12:50   ` Sergey Rudyshin
2020-01-08 13:37     ` Derrick Stolee
2020-01-08 17:04       ` Sergey Rudyshin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.514.git.1578393057.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=540555@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).