Skip to content

Commit 6542cac

Browse files
To1negitster
authored andcommitted
replay: use stuck form in documentation and help message
gitcli(7) suggests to use stuck form. Change the documentation strings to use this form. While at it, reorder them to match the order in the docs. Signed-off-by: Toon Claes <toon@iotcl.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent e5ae639 commit 6542cac

2 files changed

Lines changed: 15 additions & 14 deletions

File tree

Documentation/git-replay.adoc

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ git-replay - EXPERIMENTAL: Replay commits on a new base, works with bare repos t
99
SYNOPSIS
1010
--------
1111
[verse]
12-
(EXPERIMENTAL!) 'git replay' ([--contained] --onto <newbase> | --advance <branch> | --revert <branch>) [--ref-action[=<mode>]] <revision-range>
12+
(EXPERIMENTAL!) 'git replay' ([--contained] --onto=<newbase> | --advance=<branch> | --revert=<branch>)
13+
[--ref-action=<mode>] <revision-range>
1314

1415
DESCRIPTION
1516
-----------
@@ -26,23 +27,23 @@ THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
2627
OPTIONS
2728
-------
2829

29-
--onto <newbase>::
30+
--onto=<newbase>::
3031
Starting point at which to create the new commits. May be any
3132
valid commit, and not just an existing branch name.
3233
+
3334
When `--onto` is specified, the branch(es) in the revision range will be
3435
updated to point at the new commits, similar to the way `git rebase --update-refs`
3536
updates multiple branches in the affected range.
3637

37-
--advance <branch>::
38+
--advance=<branch>::
3839
Starting point at which to create the new commits; must be a
3940
branch name.
4041
+
4142
The history is replayed on top of the <branch> and <branch> is updated to
4243
point at the tip of the resulting history. This is different from `--onto`,
4344
which uses the target only as a starting point without updating it.
4445

45-
--revert <branch>::
46+
--revert=<branch>::
4647
Starting point at which to create the reverted commits; must be a
4748
branch name.
4849
+
@@ -79,8 +80,8 @@ The default mode can be configured via the `replay.refAction` configuration vari
7980

8081
<revision-range>::
8182
Range of commits to replay; see "Specifying Ranges" in
82-
linkgit:git-rev-parse[1]. In `--advance <branch>` or
83-
`--revert <branch>` mode, the range should have a single tip,
83+
linkgit:git-rev-parse[1]. In `--advance=<branch>` or
84+
`--revert=<branch>` mode, the range should have a single tip,
8485
so that it's clear to which tip the advanced or reverted
8586
<branch> should point. Any commits in the range whose changes
8687
are already present in the branch the commits are being
@@ -127,22 +128,22 @@ EXAMPLES
127128
To simply rebase `mybranch` onto `target`:
128129

129130
------------
130-
$ git replay --onto target origin/main..mybranch
131+
$ git replay --onto=target origin/main..mybranch
131132
------------
132133

133134
The refs are updated atomically and no output is produced on success.
134135

135136
To see what would be updated without actually updating:
136137

137138
------------
138-
$ git replay --ref-action=print --onto target origin/main..mybranch
139+
$ git replay --ref-action=print --onto=target origin/main..mybranch
139140
update refs/heads/mybranch ${NEW_mybranch_HASH} ${OLD_mybranch_HASH}
140141
------------
141142

142143
To cherry-pick the commits from mybranch onto target:
143144

144145
------------
145-
$ git replay --advance target origin/main..mybranch
146+
$ git replay --advance=target origin/main..mybranch
146147
------------
147148

148149
Note that the first two examples replay the exact same commits and on
@@ -154,7 +155,7 @@ What if you have a stack of branches, one depending upon another, and
154155
you'd really like to rebase the whole set?
155156

156157
------------
157-
$ git replay --contained --onto origin/main origin/main..tipbranch
158+
$ git replay --contained --onto=origin/main origin/main..tipbranch
158159
------------
159160

160161
All three branches (`branch1`, `branch2`, and `tipbranch`) are updated
@@ -165,7 +166,7 @@ commits to replay using the syntax `A..B`; any range expression will
165166
do:
166167

167168
------------
168-
$ git replay --onto origin/main ^base branch1 branch2 branch3
169+
$ git replay --onto=origin/main ^base branch1 branch2 branch3
169170
------------
170171

171172
This will simultaneously rebase `branch1`, `branch2`, and `branch3`,
@@ -176,7 +177,7 @@ that they have in common, but that does not need to be the case.
176177
To revert commits on a branch:
177178

178179
------------
179-
$ git replay --revert main topic~2..topic
180+
$ git replay --revert=main topic~2..topic
180181
------------
181182

182183
This reverts the last two commits from `topic`, creating revert commits on

builtin/replay.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ int cmd_replay(int argc,
8484

8585
const char *const replay_usage[] = {
8686
N_("(EXPERIMENTAL!) git replay "
87-
"([--contained] --onto <newbase> | --advance <branch> | --revert <branch>) "
88-
"[--ref-action[=<mode>]] <revision-range>"),
87+
"([--contained] --onto=<newbase> | --advance=<branch> | --revert=<branch>)\n"
88+
"[--ref-action=<mode>] <revision-range>"),
8989
NULL
9090
};
9191
struct option replay_options[] = {

0 commit comments

Comments
 (0)