Skip to contentSkip to conversation

doc: replay: improvements like "mention no output on conflicts"

PATCH Superseded [email protected] 6 participants 28 messages Dec 7, 2025 – Dec 20, 2025 Documentation

lore
Share & tools
lore
#0 lore raw

cover doc: replay: improvements like "mention no output on conflicts"

From: Kristoffer Haugsbakk <[email protected]>

Explicitly say that conflicts do not give any output. I found this a bit confusing with the current doc since I am used to other commands complaining loudly.

Also two other things:

Kristoffer Haugsbakk (3):
doc: replay: mention no output on conflicts
doc: replay: document --contained
doc: replay: link section using markup

 Documentation/git-replay.adoc | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

base-commit: bdc5341ff65278a3cc80b2e8a02a2f02aa1fac06

Signature · 1 line
2.52.0.10.g08704017180
#1 lore raw

PATCH 1/3 doc: replay: mention no output on conflicts

From: Kristoffer Haugsbakk <[email protected]>

Some commands will produce output on stderr if there are conflicts, but git-replay(1) is completely silent. Explicitly spell that out.

---
 Documentation/git-replay.adoc | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/git-replay.adoc +4 -0
index dcb26e8a8e8..6fbb527b9d8 100644
@@ -81,6 +81,10 @@ the shape of the history being replayed.  When using `--advance`, the
 number of refs updated is always one, but for `--onto`, it can be one
 or more (rebasing multiple branches simultaneously is supported).
 
+There is no stderr output on conflicts; see the <<exit-status,EXIT
+STATUS>> section below.
+
+[[exit-status]]
 EXIT STATUS
 -----------
 
Signature · 1 line
2.52.0.10.g08704017180
#2 lore raw

PATCH 2/3 doc: replay: document --contained

In reply to [email protected]

From: Kristoffer Haugsbakk <[email protected]>

Copy the text from replay_options in builtin/replay.c.

---
 Documentation/git-replay.adoc | 3 +++
 1 file changed, 3 insertions(+)
Documentation/git-replay.adoc +3 -0
index 6fbb527b9d8..1b8661185bb 100644
@@ -42,6 +42,9 @@ The history is replayed on top of the <branch> and <branch> is updated to
 point at the tip of the resulting history. This is different from `--onto`,
 which uses the target only as a starting point without updating it.
 
+--contained::
+	Advance all branches contained in <revision-range>.
+
 --ref-action[=<mode>]::
 	Control how references are updated. The mode can be:
 +
Signature · 1 line
2.52.0.10.g08704017180
#3 lore raw

PATCH 3/3 doc: replay: link section using markup

In reply to [email protected]

From: Kristoffer Haugsbakk <[email protected]>

---
 Documentation/git-replay.adoc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/git-replay.adoc +2 -1
index 1b8661185bb..04944a5fa23 100644
@@ -19,7 +19,7 @@ the working tree and the index untouched. By default, updates the
 relevant references using an atomic transaction (all refs update or
 none). Use `--ref-action=print` to avoid automatic ref updates and
 instead get update commands that can be piped to `git update-ref --stdin`
-(see the OUTPUT section below).
+(see the <<output,OUTPUT>> section below).
 
 THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
 
@@ -66,6 +66,7 @@ The default mode can be configured via the `replay.refAction` configuration vari
 
 include::rev-list-options.adoc[]
 
+[[output]]
 OUTPUT
 ------
 
Signature · 1 line
2.52.0.10.g08704017180
#4 lore raw
In reply to [email protected]
Quoted 13 lines · [email protected] writes:

From: Kristoffer Haugsbakk <[email protected]>

Explicitly say that conflicts do not give any output. I found this a bit confusing with the current doc since I am used to other commands complaining loudly.

Also two other things:

Kristoffer Haugsbakk (3):
doc: replay: mention no output on conflicts
doc: replay: document --contained
doc: replay: link section using markup

Quoted 5 lines
 Documentation/git-replay.adoc | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

base-commit: bdc5341ff65278a3cc80b2e8a02a2f02aa1fac06

All looked sensible.

The second one looked a bit sketchy, but that was the phrase used by the log message for c4611130 (replay: add --contained to rebase contained branches, 2023-11-24).

#5 lore raw
Quoted 9 lines · Junio C Hamano
Quoted 2 lines · [email protected] writes:

[snip]
base-commit: bdc5341ff65278a3cc80b2e8a02a2f02aa1fac06

All looked sensible.

The second one looked a bit sketchy, but that was the phrase used by the log message for c4611130 (replay: add --contained to rebase contained branches, 2023-11-24).

How should --contained be documented?

#6 lore raw
Quoted 5 lines · Kristoffer Haugsbakk
Quoted 4 lines · Junio C Hamano
Quoted 2 lines · [email protected] writes:

[snip]
base-commit: bdc5341ff65278a3cc80b2e8a02a2f02aa1fac06

Quoted 7 lines
Quoted 5 lines

All looked sensible.

The second one looked a bit sketchy, but that was the phrase used by the log message for c4611130 (replay: add --contained to rebase contained branches, 2023-11-24).

How should --contained be documented?

The text you added uses exactly the phrase used by the log message, so the author of the feature apparently felt it is good enough ;-).

It just felt that "contained in <revision-range>" is understandable enough. For example, I am unsure if somebody who read the document can accurately answer the following question:

If you forked 7-commit series from v1.0, merged the early 3 commits to the 'master' branch, and merged the rest to the 'next' branch, is that branch contained in 'master..next'? Or it is not because the bottommost 3 commits are not part of master..next? If it is the former, is it because the topmost commit (i.e., the commit pointed at by the branch reference) is the only thing that counts, and it indeed is master..next?

#7 lore raw
Quoted 8 lines · Junio C Hamano
Quoted 8 lines
Quoted 7 lines

[snip]

All looked sensible.

The second one looked a bit sketchy, but that was the phrase used by the log message for c4611130 (replay: add --contained to rebase contained branches, 2023-11-24).

Quoted 7 lines
Quoted 1 line

How should --contained be documented?

The text you added uses exactly the phrase used by the log message, so the author of the feature apparently felt it is good enough ;-).

It just felt that "contained in <revision-range>" is understandable enough.

“is [not]” presumably.

I read it as this with pseudo-decoration.

    abcde (refs/heads/topic2)
    12345
    56789 (refs/heads/topic1)
    0abcd

topic1 and topic2 are contained and will be updated.

Quoted 6 lines

For example, I am unsure if somebody who read the document can accurately answer the following question:

If you forked 7-commit series from v1.0, merged the early 3 commits to the 'master' branch, and merged the rest to the 'next' branch, is that branch contained in 'master..next'?

I tested that with, let’s say, topic-1 merged to a test-master (and topic-2 merged to a `test-next).

git log test-master..test-next was as expected (no topic-1). Replaying onto one commit on top of test-next:[1]

    $ git replay --contained --onto=test-target test-master..test-next
    <exit code 1>

I guess the “duplicates” (patch-id) cause this?

Quoted 4 lines

Or it is not because the bottommost 3 commits are not part of master..next? If it is the former, is it because the topmost commit (i.e., the commit pointed at by the branch reference) is the only thing that counts, and it indeed is master..next?

It’s a somewhat complex case compared to what I think is the usual one:
a non-merge range of commits without any patch-id-equivalents on the target (fingers crossed). And the setup without merges: two topic branches in the range gives the output I expect:

    git replay --contained --onto=target2 <range>
    update <top/second>
    update <bottom/first>

I think the original phrasing is understandable. But we could add an example.

For example, if the range contains five commits where a branch points to the newest commit and another branch points to the third commit ...

And should the description in the source (replay.c) be updated as well? This goes for Phillip’s point about “Requires --onto” as well.

† 1: By the way: me mistyping --onto=<branch> where <branch> doesn’t
exist causes this error:

fatal: Replaying down to root commit is not supported yet!

#8 lore raw
Quoted 11 lines · Kristoffer Haugsbakk
Quoted 10 lines · Junio C Hamano
Quoted 9 lines
Quoted 7 lines

[snip]

All looked sensible.

The second one looked a bit sketchy, but that was the phrase used by the log message for c4611130 (replay: add --contained to rebase contained branches, 2023-11-24).

How should --contained be documented?

Quoted 7 lines
Quoted 5 lines

The text you added uses exactly the phrase used by the log message, so the author of the feature apparently felt it is good enough ;-).

It just felt that "contained in <revision-range>" is understandable enough.

“is [not]” presumably.

Actually, s/It felt/I was unsure/;-).

Quoted 13 lines
Quoted 3 lines

master..next? If it is the former, is it because the topmost commit (i.e., the commit pointed at by the branch reference) is the only thing that counts, and it indeed is master..next?

It’s a somewhat complex case compared to what I think is the usual one:
a non-merge range of commits without any patch-id-equivalents on the target (fingers crossed). And the setup without merges: two topic branches in the range gives the output I expect:

    git replay --contained --onto=target2 <range>
    update <top/second>
    update <bottom/first>
Quoted 6 lines

I think the original phrasing is understandable. But we could add an example.

For example, if the range contains five commits where a branch points to the newest commit and another branch points to the third commit ...

Alternatively, you can explicitly refer to "the tip of the branch"; that phrasing will be understood by people from both camps. Those who considers that a "branch" consists of the commits between the fork point and its tip, and those who thinks a "branch" is a fancy name attached to one particular commit in the DAG that can move around (typically forward). Those branches whose tips are within the range are updated.

#9 lore raw
In reply to Kristoffer Haugsbakk
Quoted 3 lines · Kristoffer Haugsbakk
Quoted 3 lines
Quoted 3 lines

Explicitly say that conflicts do not give any output. I found this a bit confusing with the current doc since I am used to other commands complaining loudly.

Yeah I agree it's unusual, and I'm considering to submit patches to change that behavior. But for now, thanks for adding these docs changes.

Quoted 9 lines · Junio C Hamano
Quoted 6 lines

All looked sensible.

The second one looked a bit sketchy, but that was the phrase used by the log message for c4611130 (replay: add --contained to rebase contained branches, 2023-11-24).

How should --contained be documented?

I understand it might sound a bit cryptic, if you don't have any prior knowledge about this command. But on the other hand, I don't have any good idea how you can document this in more detail. I think it's fine like this.

Overall, I agree with these changes.

Signature · 2 lines
Cheers,
Toon
#10 lore raw
Quoted 8 lines · Toon Claes
Quoted 3 lines · Kristoffer Haugsbakk
Quoted 3 lines
Quoted 3 lines

Explicitly say that conflicts do not give any output. I found this a bit confusing with the current doc since I am used to other commands complaining loudly.

Yeah I agree it's unusual, and I'm considering to submit patches to change that behavior. But for now, thanks for adding these docs changes.

Thanks for reviewing/checking this out!

Quoted 8 lines
Quoted 8 lines · Junio C Hamano
Quoted 6 lines

All looked sensible.

The second one looked a bit sketchy, but that was the phrase used by the log message for c4611130 (replay: add --contained to rebase contained branches, 2023-11-24).

Quoted 6 lines
Quoted 1 line

How should --contained be documented?

I understand it might sound a bit cryptic, if you don't have any prior knowledge about this command. But on the other hand, I don't have any good idea how you can document this in more detail. I think it's fine like this.

It sounds like it is the same as git rebase --update-refs. I guess that could be mentioned?

Quoted 2 lines

Overall, I agree with these changes.

#11 lore raw
In reply to Kristoffer Haugsbakk
Quoted 5 lines · Kristoffer Haugsbakk
Quoted 4 lines · Junio C Hamano
Quoted 2 lines · [email protected] writes:

[snip]
base-commit: bdc5341ff65278a3cc80b2e8a02a2f02aa1fac06

Quoted 7 lines
Quoted 5 lines

All looked sensible.

The second one looked a bit sketchy, but that was the phrase used by the log message for c4611130 (replay: add --contained to rebase contained branches, 2023-11-24).

How should --contained be documented?

Maybe something like

Update all branches whose head commits are replayed. Requires --onto.

Thanks

Phillip

#12 lore raw
Quoted 9 lines · Phillip Wood
Quoted 8 lines · Kristoffer Haugsbakk
Quoted 6 lines · Junio C Hamano
Quoted 1 line · [email protected] writes:

[snip]

The second one looked a bit sketchy, but that was the phrase used by the log message for c4611130 (replay: add --contained to rebase contained branches, 2023-11-24).

Quoted 6 lines
Quoted 1 line

How should --contained be documented?

Maybe something like

Update all branches whose head commits are replayed. Requires --onto.

Thanks for the suggestion, and nice catch with the --onto. Very personally I don’t like involving “head” terminology. Both because of personal biases[1] as well as introducing “head” as a noun in the doc (now it just talks about refs/heads/).

I will discuss the current phrasing “Advance all branches contained in <revision-range>” in my next email.

† 1: I like the school-of-terminology that says that branches are just a
particular ref namespace that point to a commit; a branch points to a commit, that’s it, that’s all a branch is. Contrast with the “branch” gitglossary(7) which says that

A "branch" is a line of development. The most recent commit on a branch is referred to as the tip of that branch. ...

This is both more involved and causes pedagogical headaches as people start wrestling with where a branch “begins” (it is a “line of development” after all) in the face of inevitable moves of the branch where it started (but the “branch where it started” is of course immaterial; it’s the commit that that other branch pointed at *at* the time that matters ...) ...

#13 lore raw
Quoted 11 lines · Kristoffer Haugsbakk

On Mon, Dec 8, 2025, at 17:00, Phillip Wood wrote:
...

Quoted 4 lines

Maybe something like

Update all branches whose head commits are replayed. Requires --onto.

Thanks for the suggestion, and nice catch with the --onto. Very personally I don’t like involving “head” terminology. Both because of personal biases[1] as well as introducing “head” as a noun in the doc (now it just talks about refs/heads/).

Yeah, I do not recall calling commit at the tip of a branch a "head commit".

#14 lore raw
Quoted 9 lines · Junio C Hamano
Quoted 7 lines · Kristoffer Haugsbakk

On Mon, Dec 8, 2025, at 17:00, Phillip Wood wrote:
...

Quoted 4 lines

Maybe something like

Update all branches whose head commits are replayed. Requires --onto.

Quoted 7 lines
Quoted 4 lines

Thanks for the suggestion, and nice catch with the --onto. Very personally I don’t like involving “head” terminology. Both because of personal biases[1] as well as introducing “head” as a noun in the doc (now it just talks about refs/heads/).

Yeah, I do not recall calling commit at the tip of a branch a "head commit".

We do talk about "branch heads" in our documentation and they point commits. We also use "tip" when talking about the commit the branch points to so maybe something like

Update all branches whose tip is replayed

though I think it would be clearer if we could say "commit" somewhere as that's what we're replaying. I find the concept of "contained branches" rather obscure.

Thanks

Phillip

#15 lore raw
Quoted 9 lines · Phillip Wood

We do talk about "branch heads" in our documentation and they point commits. We also use "tip" when talking about the commit the branch points to so maybe something like

Update all branches whose tip is replayed

though I think it would be clearer if we could say "commit" somewhere as that's what we're replaying. I find the concept of "contained branches" rather obscure.

Thanks, I do agree that "branch head", "tip of the branch", etc. can be used pretty much interchangeably, and using "commit" somwhere would make it clear.

Update all branches that point at commits in the replayed <revision-range>.

perhaps? I dunno.

#16 lore raw
Quoted 12 lines · Junio C Hamano
Quoted 9 lines · Phillip Wood

We do talk about "branch heads" in our documentation and they point commits. We also use "tip" when talking about the commit the branch points to so maybe something like

Update all branches whose tip is replayed

though I think it would be clearer if we could say "commit" somewhere as that's what we're replaying. I find the concept of "contained branches" rather obscure.

Quoted 8 lines

Thanks, I do agree that "branch head", "tip of the branch", etc. can be used pretty much interchangeably, and using "commit" somwhere would make it clear.

Update all branches that point at commits in the replayed <revision-range>.

perhaps? I dunno.

I like this. Or just

Update all branches that point at commits in <revision-range>.

#17 lore raw
Quoted 17 lines · Kristoffer Haugsbakk
Quoted 16 lines · Junio C Hamano
Quoted 9 lines · Phillip Wood

We do talk about "branch heads" in our documentation and they point commits. We also use "tip" when talking about the commit the branch points to so maybe something like

Update all branches whose tip is replayed

though I think it would be clearer if we could say "commit" somewhere as that's what we're replaying. I find the concept of "contained branches" rather obscure.

Thanks, I do agree that "branch head", "tip of the branch", etc. can be used pretty much interchangeably, and using "commit" somwhere would make it clear.

Quoted 8 lines
Quoted 4 lines

Update all branches that point at commits in the replayed <revision-range>.

perhaps? I dunno.

I like this. Or just

Update all branches that point at commits in <revision-range>.

I'd be happy with either one

Thanks

Phillip

#18 lore raw
Quoted 22 lines · Phillip Wood
Quoted 20 lines · Kristoffer Haugsbakk
Quoted 19 lines · Junio C Hamano
Quoted 9 lines · Phillip Wood

We do talk about "branch heads" in our documentation and they point commits. We also use "tip" when talking about the commit the branch points to so maybe something like

Update all branches whose tip is replayed

though I think it would be clearer if we could say "commit" somewhere as that's what we're replaying. I find the concept of "contained branches" rather obscure.

Thanks, I do agree that "branch head", "tip of the branch", etc. can be used pretty much interchangeably, and using "commit" somwhere would make it clear.

Update all branches that point at commits in the replayed <revision-range>.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

perhaps? I dunno.

I like this. Or just

Update all branches that point at commits in <revision-range>.

I'd be happy with either one

Same.

#19 lore raw

v2 cover doc: replay: improvements like "mention no output on conflicts"

In reply to [email protected]

From: Kristoffer Haugsbakk <[email protected]>

Explicitly say that conflicts do not give any output. I found this a bit confusing with the current doc since I am used to other commands complaining loudly.

§ Changes in v2

Patch 2/3: improve --contained and mention that it requires --onto.

Kristoffer Haugsbakk (3):
doc: replay: mention no output on conflicts
replay: improve --contained and add to doc
doc: replay: link section using markup

 Documentation/git-replay.adoc | 11 ++++++++++-
 builtin/replay.c              |  2 +-
 2 files changed, 11 insertions(+), 2 deletions(-)

Interdiff against v1:

Documentation/git-replay.adoc +2 -1
index 04944a5fa23..22fd1b271af 100644
@@ -43,7 +43,8 @@ point at the tip of the resulting history. This is different from `--onto`,
 which uses the target only as a starting point without updating it.
 
 --contained::
-	Advance all branches contained in <revision-range>.
+	Update all branches that point at commits in
+	<revision-range>. Requires `--onto`.
 
 --ref-action[=<mode>]::
 	Control how references are updated. The mode can be:
builtin/replay.c +1 -1
index 6606a2c94bc..9e5ad64cad6 100644
@@ -377,7 +377,7 @@ int cmd_replay(int argc,
 			   N_("revision"),
 			   N_("replay onto given commit")),
 		OPT_BOOL(0, "contained", &contained,
-			 N_("advance all branches contained in revision-range")),
+			 N_("update all branches that point at commits in <revision-range>")),
 		OPT_STRING(0, "ref-action", &ref_action,
 			   N_("mode"),
 			   N_("control ref update behavior (update|print)")),

Range-diff against v1:

1:  b9ec24c8b8f = 1:  b9ec24c8b8f doc: replay: mention no output on conflicts
2:  02a80ee87b5 ! 2:  27bf2ac7a0b doc: replay: document --contained

@@ Metadata
Author: Kristoffer Haugsbakk <[email protected]>

## Commit message ##
- doc: replay: document --contained
+ replay: improve --contained and add to doc

- Copy the text from replay_options in builtin/replay.c.
+ There is no documentation for --contained.

+ Start by copying the text from replay_options in `builtin/
+ replay.c`. But some people think that the existing text is a
+ bit unclear; what does it mean for a branch to be contained
+ in a revision range? Let’s include the implied commits here:
+ the branches that point at commits in the range.
+
+ Also use “update” instead of “advance”. “Update” is the verb
+ commonly used in this context.
+
+ Helped-by: Phillip Wood <[email protected]>
+ Helped-by: Junio C Hamano <[email protected]>

+
+ ## Notes (series) ##
+ v2:
+
+ Don’t just copy --contained over. Improve it on both sites after discussing
+ with reviewers.
+
+ Also mention that --onto is required.
+
## Documentation/git-replay.adoc ##
@@ Documentation/git-replay.adoc: The history is replayed on top of the <branch> and <branch> is updated to
point at the tip of the resulting history. This is different from --onto,
which uses the target only as a starting point without updating it.

+--contained::
-+ Advance all branches contained in <revision-range>.
++ Update all branches that point at commits in
++ <revision-range>. Requires --onto.
+
--ref-action[=<mode>]::
Control how references are updated. The mode can be:
+
+
+ ## builtin/replay.c ##
+@@ builtin/replay.c: int cmd_replay(int argc,
+ N_("revision"),
+ N_("replay onto given commit")),
+ OPT_BOOL(0, "contained", &contained,
+- N_("advance all branches contained in revision-range")),
++ N_("update all branches that point at commits in <revision-range>")),
+ OPT_STRING(0, "ref-action", &ref_action,
+ N_("mode"),
+ N_("control ref update behavior (update|print)")),
3: ca83b00343d = 3: 4e851fdff34 doc: replay: link section using markup

base-commit: bdc5341ff65278a3cc80b2e8a02a2f02aa1fac06

Signature · 1 line
2.52.0.10.g08704017180
#20 lore raw

PATCH v2 1/3 doc: replay: mention no output on conflicts

From: Kristoffer Haugsbakk <[email protected]>

Some commands will produce output on stderr if there are conflicts, but git-replay(1) is completely silent. Explicitly spell that out.

---
 Documentation/git-replay.adoc | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/git-replay.adoc +4 -0
index dcb26e8a8e8..6fbb527b9d8 100644
@@ -81,6 +81,10 @@ the shape of the history being replayed.  When using `--advance`, the
 number of refs updated is always one, but for `--onto`, it can be one
 or more (rebasing multiple branches simultaneously is supported).
 
+There is no stderr output on conflicts; see the <<exit-status,EXIT
+STATUS>> section below.
+
+[[exit-status]]
 EXIT STATUS
 -----------
 
Signature · 1 line
2.52.0.10.g08704017180
#21 lore raw

PATCH v2 2/3 replay: improve --contained and add to doc

In reply to [email protected]

From: Kristoffer Haugsbakk <[email protected]>

There is no documentation for --contained.

Start by copying the text from replay_options in builtin/ replay.c. But some people think that the existing text is a bit unclear; what does it mean for a branch to be contained in a revision range? Let’s include the implied commits here:
the branches that point at commits in the range.

Also use “update” instead of “advance”. “Update” is the verb commonly used in this context.

---

Notes (series):
v2:

Don’t just copy --contained over. Improve it on both sites after discussing with reviewers.

Also mention that --onto is required.

 Documentation/git-replay.adoc | 4 ++++
 builtin/replay.c              | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
Documentation/git-replay.adoc +4 -0
index 6fbb527b9d8..1e2469b9034 100644
@@ -42,6 +42,10 @@ The history is replayed on top of the <branch> and <branch> is updated to
 point at the tip of the resulting history. This is different from `--onto`,
 which uses the target only as a starting point without updating it.
 
+--contained::
+	Update all branches that point at commits in
+	<revision-range>. Requires `--onto`.
+
 --ref-action[=<mode>]::
 	Control how references are updated. The mode can be:
 +
builtin/replay.c +1 -1
index 6606a2c94bc..9e5ad64cad6 100644
@@ -377,7 +377,7 @@ int cmd_replay(int argc,
 			   N_("revision"),
 			   N_("replay onto given commit")),
 		OPT_BOOL(0, "contained", &contained,
-			 N_("advance all branches contained in revision-range")),
+			 N_("update all branches that point at commits in <revision-range>")),
 		OPT_STRING(0, "ref-action", &ref_action,
 			   N_("mode"),
 			   N_("control ref update behavior (update|print)")),
Signature · 1 line
2.52.0.10.g08704017180
#22 lore raw

PATCH v2 3/3 doc: replay: link section using markup

In reply to [email protected]

From: Kristoffer Haugsbakk <[email protected]>

---
 Documentation/git-replay.adoc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/git-replay.adoc +2 -1
index 1e2469b9034..22fd1b271af 100644
@@ -19,7 +19,7 @@ the working tree and the index untouched. By default, updates the
 relevant references using an atomic transaction (all refs update or
 none). Use `--ref-action=print` to avoid automatic ref updates and
 instead get update commands that can be piped to `git update-ref --stdin`
-(see the OUTPUT section below).
+(see the <<output,OUTPUT>> section below).
 
 THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
 
@@ -67,6 +67,7 @@ The default mode can be configured via the `replay.refAction` configuration vari
 
 include::rev-list-options.adoc[]
 
+[[output]]
 OUTPUT
 ------
 
Signature · 1 line
2.52.0.10.g08704017180
#23 lore raw
In reply to [email protected]
Quoted 9 lines · On 13/12/2025 13:46, [email protected] wrote:

From: Kristoffer Haugsbakk <[email protected]>

Explicitly say that conflicts do not give any output. I found this a bit confusing with the current doc since I am used to other commands complaining loudly.

§ Changes in v2

Patch 2/3: improve --contained and mention that it requires --onto.

The new text looks good, I don't really understand the commit message but the intent of the change is clear enough.

Thanks for improving the documentation

Phillip

Quoted 99 lines

Kristoffer Haugsbakk (3):
doc: replay: mention no output on conflicts
replay: improve --contained and add to doc
doc: replay: link section using markup

  Documentation/git-replay.adoc | 11 ++++++++++-
  builtin/replay.c              |  2 +-
  2 files changed, 11 insertions(+), 2 deletions(-)

Interdiff against v1:

Documentation/git-replay.adoc +2 -1
index 04944a5fa23..22fd1b271af 100644
@@ -43,7 +43,8 @@ point at the tip of the resulting history. This is different from `--onto`,
  which uses the target only as a starting point without updating it.
 
  --contained::
-	Advance all branches contained in <revision-range>.
+	Update all branches that point at commits in
+	<revision-range>. Requires `--onto`.
 
  --ref-action[=<mode>]::
  	Control how references are updated. The mode can be:
builtin/replay.c +1 -1
index 6606a2c94bc..9e5ad64cad6 100644
@@ -377,7 +377,7 @@ int cmd_replay(int argc,
  			   N_("revision"),
  			   N_("replay onto given commit")),
  		OPT_BOOL(0, "contained", &contained,
-			 N_("advance all branches contained in revision-range")),
+			 N_("update all branches that point at commits in <revision-range>")),
  		OPT_STRING(0, "ref-action", &ref_action,
  			   N_("mode"),
  			   N_("control ref update behavior (update|print)")),

Range-diff against v1:

1:  b9ec24c8b8f = 1:  b9ec24c8b8f doc: replay: mention no output on conflicts
2:  02a80ee87b5 ! 2:  27bf2ac7a0b doc: replay: document --contained

@@ Metadata
Author: Kristoffer Haugsbakk <[email protected]>

## Commit message ##
- doc: replay: document --contained
+ replay: improve --contained and add to doc

- Copy the text from replay_options in builtin/replay.c.
+ There is no documentation for --contained.

+ Start by copying the text from replay_options in `builtin/
+ replay.c`. But some people think that the existing text is a
+ bit unclear; what does it mean for a branch to be contained
+ in a revision range? Let’s include the implied commits here:
+ the branches that point at commits in the range.
+
+ Also use “update” instead of “advance”. “Update” is the verb
+ commonly used in this context.
+
+ Helped-by: Phillip Wood <[email protected]>
+ Helped-by: Junio C Hamano <[email protected]>

+
+ ## Notes (series) ##
+ v2:
+
+ Don’t just copy --contained over. Improve it on both sites after discussing
+ with reviewers.
+
+ Also mention that --onto is required.
+
## Documentation/git-replay.adoc ##
@@ Documentation/git-replay.adoc: The history is replayed on top of the <branch> and <branch> is updated to
point at the tip of the resulting history. This is different from --onto,
which uses the target only as a starting point without updating it.

+--contained::
-+ Advance all branches contained in <revision-range>.
++ Update all branches that point at commits in
++ <revision-range>. Requires --onto.
+
--ref-action[=<mode>]::
Control how references are updated. The mode can be:
+
+
+ ## builtin/replay.c ##
+@@ builtin/replay.c: int cmd_replay(int argc,
+ N_("revision"),
+ N_("replay onto given commit")),
+ OPT_BOOL(0, "contained", &contained,
+- N_("advance all branches contained in revision-range")),
++ N_("update all branches that point at commits in <revision-range>")),
+ OPT_STRING(0, "ref-action", &ref_action,
+ N_("mode"),
+ N_("control ref update behavior (update|print)")),
3: ca83b00343d = 3: 4e851fdff34 doc: replay: link section using markup

base-commit: bdc5341ff65278a3cc80b2e8a02a2f02aa1fac06

#24 lore raw
Quoted 7 lines · Phillip Wood
Quoted 6 lines · On 13/12/2025 13:46, [email protected] wrote:

From: Kristoffer Haugsbakk <[email protected]>

Explicitly say that conflicts do not give any output. I found this a bit confusing with the current doc since I am used to other commands complaining loudly.

Quoted 8 lines
Quoted 3 lines

§ Changes in v2

Patch 2/3: improve --contained and mention that it requires --onto.

The new text looks good, I don't really understand the commit message but the intent of the change is clear enough.

Thanks for improving the documentation

Thank you. But I’m not glad that the commit message is not clear. I would need some guidance on how to write it because it seems clear to me. Something with my brain state I guess.

#25 lore raw
Quoted 12 lines · Kristoffer Haugsbakk
Quoted 11 lines · Phillip Wood
Quoted 9 lines · On 13/12/2025 13:46, [email protected] wrote:

From: Kristoffer Haugsbakk <[email protected]>

Explicitly say that conflicts do not give any output. I found this a bit confusing with the current doc since I am used to other commands complaining loudly.

§ Changes in v2

Patch 2/3: improve --contained and mention that it requires --onto.

Quoted 8 lines
Quoted 4 lines

The new text looks good, I don't really understand the commit message but the intent of the change is clear enough.

Thanks for improving the documentation

Thank you. But I’m not glad that the commit message is not clear. I would need some guidance on how to write it because it seems clear to me. Something with my brain state I guess.

They are already in 'next', but let's see if there are pain points.

commit 8467c95419acaa826a6c1ca0db0f36a3fd614ae4

Author: Kristoffer Haugsbakk <[email protected]>
Date:   Sat Dec 13 14:46:56 2025 +0100

doc: replay: mention no output on conflicts

Some commands will produce output on stderr if there are conflicts, but git-replay(1) is completely silent. Explicitly spell that out.

Looks clear enough to me.

commit 03d7c9c457ba68f28269dcd607b9026ea6c6c9c8

Author: Kristoffer Haugsbakk <[email protected]>
Date:   Sat Dec 13 14:46:57 2025 +0100

replay: improve --contained and add to doc

There is no documentation for --contained.

Start by copying the text from replay_options in builtin/ replay.c. But some people think that the existing text is a bit unclear; what does it mean for a branch to be contained in a revision range? Let’s include the implied commits here:
the branches that point at commits in the range.

Also use “update” instead of “advance”. “Update” is the verb commonly used in this context.

As to the title, "improve --contained" hinted me there is some code changes for behaviour, but there isn't, so that part may have been a bit misleading. "improve short-help of --contained and add to doc", perhaps.

I think the problem people found in the second paragraph is because it is so unclear what it is talking about if you read it without looking at the patch text. You started from the existing "advance all branches contained in revision-range", taken from the existing short-help in replay_options[]. But without seeing that "branches contained" text, it is natural that readers find it hard to judge the validity of "But some people think that..." claim themselves.

If I were writing this (but I will not rewind 'next' to do so), I'd say something like:

replay: improve the help of the --contained option and document it

"git replay -h" explains "--contained" as

advance all branches contained in revision-range

but it may be unclear when exactly a branch is contained in a revision range. Because the command updates a branch that points at a commit that gets rewritten to point at the result of the rewrite, "update branches that point at commits in the range" says what we want to say more clearly and concisely.

The "--contained" option has no description in "git replay" documentation. Use the improved phrase there, too.

probably. In any case, it is a good exercise to see if the proposed log message can be easily understood without looking at the code change.

commit 9ba08b30a117e6925a9e5e87c92b37de7396d3a4

Author: Kristoffer Haugsbakk <[email protected]>
Date:   Sat Dec 13 14:46:58 2025 +0100

doc: replay: link section using markup

Looking good.

#26 lore raw
Quoted 33 lines · Junio C Hamano
Quoted 4 lines · Kristoffer Haugsbakk

Thank you. But I’m not glad that the commit message is not clear. I would need some guidance on how to write it because it seems clear to me. Something with my brain state I guess.

commit 03d7c9c457ba68f28269dcd607b9026ea6c6c9c8

Author: Kristoffer Haugsbakk <[email protected]>
Date:   Sat Dec 13 14:46:57 2025 +0100

replay: improve --contained and add to doc

There is no documentation for --contained.

Start by copying the text from replay_options in builtin/ replay.c. But some people think that the existing text is a bit unclear; what does it mean for a branch to be contained in a revision range? Let’s include the implied commits here:
the branches that point at commits in the range.

Also use “update” instead of “advance”. “Update” is the verb commonly used in this context.

As to the title, "improve --contained" hinted me there is some code changes for behaviour, but there isn't, so that part may have been a bit misleading. "improve short-help of --contained and add to doc", perhaps.

Quoted 7 lines

I think the problem people found in the second paragraph is because it is so unclear what it is talking about if you read it without looking at the patch text. You started from the existing "advance all branches contained in revision-range", taken from the existing short-help in replay_options[]. But without seeing that "branches contained" text, it is natural that readers find it hard to judge the validity of "But some people think that..." claim themselves.

That's a good summary of what I found confusing. I like you suggested message below but I agree it is not worth messing with it now it is in next.

Thanks

Phillip

Quoted 33 lines

If I were writing this (but I will not rewind 'next' to do so), I'd say something like:

replay: improve the help of the --contained option and document it

"git replay -h" explains "--contained" as

advance all branches contained in revision-range

but it may be unclear when exactly a branch is contained in a revision range. Because the command updates a branch that points at a commit that gets rewritten to point at the result of the rewrite, "update branches that point at commits in the range" says what we want to say more clearly and concisely.

The "--contained" option has no description in "git replay" documentation. Use the improved phrase there, too.

probably. In any case, it is a good exercise to see if the proposed log message can be easily understood without looking at the code change.

commit 9ba08b30a117e6925a9e5e87c92b37de7396d3a4

Author: Kristoffer Haugsbakk <[email protected]>
Date:   Sat Dec 13 14:46:58 2025 +0100

doc: replay: link section using markup

Looking good.

#27 lore raw
In reply to Junio C Hamano
Quoted 31 lines · Junio C Hamano
Quoted 4 lines · Kristoffer Haugsbakk

[snip]
Thank you. But I’m not glad that the commit message is not clear. I would need some guidance on how to write it because it seems clear to me. Something with my brain state I guess.

They are already in 'next', but let's see if there are pain points.

[snip]
commit 03d7c9c457ba68f28269dcd607b9026ea6c6c9c8

Author: Kristoffer Haugsbakk <[email protected]>
Date:   Sat Dec 13 14:46:57 2025 +0100

replay: improve --contained and add to doc

There is no documentation for --contained.

Start by copying the text from replay_options in builtin/ replay.c. But some people think that the existing text is a bit unclear; what does it mean for a branch to be contained in a revision range? Let’s include the implied commits here:
the branches that point at commits in the range.

Also use “update” instead of “advance”. “Update” is the verb commonly used in this context.

Quoted 4 lines

As to the title, "improve --contained" hinted me there is some code changes for behaviour, but there isn't, so that part may have been a bit misleading. "improve short-help of --contained and add to doc", perhaps.

Oh right, of course. The original area was doc and in that case this would have been fine. But I didn’t consider the replay area. So now it looks like the --contained option logic has been changed.

Quoted 24 lines

I think the problem people found in the second paragraph is because it is so unclear what it is talking about if you read it without looking at the patch text. You started from the existing "advance all branches contained in revision-range", taken from the existing short-help in replay_options[]. But without seeing that "branches contained" text, it is natural that readers find it hard to judge the validity of "But some people think that..." claim themselves.

If I were writing this (but I will not rewind 'next' to do so), I'd say something like:

replay: improve the help of the --contained option and document it

"git replay -h" explains "--contained" as

advance all branches contained in revision-range

but it may be unclear when exactly a branch is contained in a revision range. Because the command updates a branch that points at a commit that gets rewritten to point at the result of the rewrite, "update branches that point at commits in the range" says what we want to say more clearly and concisely.

Quoted 6 lines

The "--contained" option has no description in "git replay" documentation. Use the improved phrase there, too.

probably. In any case, it is a good exercise to see if the proposed log message can be easily understood without looking at the code change.

Okay, now I get it. It turns out I’m still learning how to write commit messages with the right amount of context.

And thanks to Phillip for confirming.

Quoted 1 line

[snip]