From: Junio C Hamano <gitster@pobox.com>
To: Toon Claes <toon@iotcl.com>
Cc: git@vger.kernel.org, Elijah Newren <newren@gmail.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH v6 3/3] replay: offer an option to linearize the commit topology
Date: Fri, 03 Jul 2026 13:57:03 -0700 [thread overview]
Message-ID: <xmqqbjcnhjvk.fsf@gitster.g> (raw)
In-Reply-To: <20260702-toon-git-replay-drop-merges-v6-3-78a07cdd0382@iotcl.com> (Toon Claes's message of "Thu, 02 Jul 2026 19:58:45 +0200")
Toon Claes <toon@iotcl.com> writes:
> From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> ...
> Linearizing is a distinct operation, and flattening merge commits is
> just one aspect of that. Recreating merges would be a separate mode, so
> rather than mirror git-rebase(1)'s `--rebase-merges[=<mode>]` interface,
> git-replay(1) uses its own `--linearize` option.
>
> Co-authored-by: Toon Claes <toon@iotcl.com>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> Signed-off-by: Toon Claes <toon@iotcl.com>
> ---
> Documentation/git-replay.adoc | 21 ++++++-
> builtin/replay.c | 6 +-
> replay.c | 54 ++++++++++------
> replay.h | 5 ++
> t/t3650-replay-basics.sh | 140 +++++++++++++++++++++++++++++++++++++++++-
> 5 files changed, 203 insertions(+), 23 deletions(-)
With such an extensive change in behaviour, I wonder if Dscho is
still responsible for latent bugs in this round of implementation
and documentation, or should you take the responsibility over?
> +--linearize::
> + In this mode, each replayed commit is stacked on top of the
> + previously replayed one, so all replayed commits are flattened into
> + a single linear history.
> ++
> +When a merge commit is encountered, the behavior of git-rebase(1)'s
> +option `--no-rebase-merges` is imitated. All commits in the range
> +reachable from the merge commit are replayed into a linear history, and
> +the merge commit itself is dropped. A ref that pointed to a merge commit
> +is updated to the merge's last replayed ancestor.
> ++
> +This flattens the `<revision-range>` as a whole. When multiple revision
> +ranges are given they are stacked on top of each other into one linear
> +history. Each of their refs is updated to point to its position in that
> +history. To linearize ranges separately, replay them in separate `git
> +replay` invocations.
OK, very much understandable.
> +This option is incompatible with `--revert`.
Definitely it is OK to leave it outside the scope, but I am not sure
if reverting a group of commits that happens to be "closed" and
happens to contain merges, is inherently incompatible with
flattening. If you have
----O--A
\ \
B--M--C
and you want to revert what happened while the history advanced from
O to M, I would naïvely expect that I can arrive at
----O--A
\ \
B--M--C-B'-A'
by linearly applying the inverse of A and B (in either order).
If it is an inherent limitation, then the sentence may want "because
..." at the end. Otherwise, it would make more sense to strike the
sentence from the main text, and have BUGS (or LIMITATIONS) section
at the end of the page, perhaps?
prev parent reply other threads:[~2026-07-03 20:57 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 18:37 [PATCH 0/3] Teach git-replay(1) to linearize merge commits Toon Claes
2026-06-08 18:37 ` [PATCH 1/3] replay: refactor enum replay_mode into a bool Toon Claes
2026-06-08 18:37 ` [PATCH 2/3] replay: add helper to put entry into mapped_commits Toon Claes
2026-06-08 18:37 ` [PATCH 3/3] replay: offer an option to linearize the commit topology Toon Claes
2026-06-08 19:29 ` Junio C Hamano
2026-06-10 14:26 ` Toon Claes
2026-06-10 14:49 ` [PATCH v2 0/3] Teach git-replay(1) to linearize merge commits Toon Claes
2026-06-10 14:49 ` [PATCH v2 1/3] replay: refactor enum replay_mode into a bool Toon Claes
2026-06-11 15:09 ` Justin Tobler
2026-06-12 8:19 ` Toon Claes
2026-06-10 14:49 ` [PATCH v2 2/3] replay: add helper to put entry into mapped_commits Toon Claes
2026-06-10 14:49 ` [PATCH v2 3/3] replay: offer an option to linearize the commit topology Toon Claes
2026-06-10 17:02 ` Junio C Hamano
2026-06-16 8:38 ` Toon Claes
2026-06-14 6:56 ` Elijah Newren
2026-06-16 7:09 ` Toon Claes
2026-06-16 9:26 ` [PATCH v3 0/3] Teach git-replay(1) to linearize merge commits Toon Claes
2026-06-16 9:26 ` [PATCH v3 1/3] replay: refactor enum replay_mode into a bool Toon Claes
2026-06-16 9:26 ` [PATCH v3 2/3] replay: add helper to put entry into mapped_commits Toon Claes
2026-06-16 9:26 ` [PATCH v3 3/3] replay: offer an option to linearize the commit topology Toon Claes
2026-06-22 12:41 ` [PATCH v4 0/3] Teach git-replay(1) to linearize merge commits Toon Claes
2026-06-22 12:41 ` [PATCH v4 1/3] replay: refactor enum replay_mode into a bool Toon Claes
2026-06-22 13:53 ` Patrick Steinhardt
2026-06-22 15:43 ` Junio C Hamano
2026-06-24 19:15 ` Toon Claes
2026-06-22 12:41 ` [PATCH v4 2/3] replay: add helper to put entry into mapped_commits Toon Claes
2026-06-22 13:53 ` Patrick Steinhardt
2026-06-22 12:41 ` [PATCH v4 3/3] replay: offer an option to linearize the commit topology Toon Claes
2026-06-22 13:53 ` Patrick Steinhardt
2026-06-26 5:36 ` Toon Claes
2026-06-29 8:04 ` Patrick Steinhardt
2026-06-30 9:44 ` Johannes Schindelin
2026-06-30 11:32 ` Patrick Steinhardt
2026-06-26 5:48 ` [PATCH v5 0/3] Teach git-replay(1) to linearize merge commits Toon Claes
2026-06-26 5:48 ` [PATCH v5 1/3] replay: add helper to put entry into mapped_commits Toon Claes
2026-06-26 16:50 ` Junio C Hamano
2026-06-26 5:48 ` [PATCH v5 2/3] replay: better explain how pick_regular_commit() picks a base Toon Claes
2026-06-26 5:48 ` [PATCH v5 3/3] replay: offer an option to linearize the commit topology Toon Claes
2026-06-26 17:10 ` Junio C Hamano
2026-06-27 13:44 ` Phillip Wood
2026-07-01 8:50 ` Toon Claes
2026-06-28 12:20 ` [PATCH v5 0/3] Teach git-replay(1) to linearize merge commits Johannes Schindelin
2026-06-30 13:42 ` Toon Claes
2026-07-02 17:58 ` [PATCH v6 " Toon Claes
2026-07-02 17:58 ` [PATCH v6 1/3] replay: add helper to put entry into replayed_commits Toon Claes
2026-07-02 17:58 ` [PATCH v6 2/3] replay: resolve the replay base outside pick_regular_commit() Toon Claes
2026-07-02 17:58 ` [PATCH v6 3/3] replay: offer an option to linearize the commit topology Toon Claes
2026-07-03 20:57 ` Junio C Hamano [this message]
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=xmqqbjcnhjvk.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=newren@gmail.com \
--cc=toon@iotcl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.