Skip to content

Commit 64a443e

Browse files
zivarahgitster
authored andcommitted
docs: clean up --empty formatting in git-rebase(1) and git-am(1)
Both of these pages document very similar `--empty` options, but with different styles. The exact behavior of these `--empty` options differs somewhat, but consistent styling in the docs is still beneficial. This commit aims to make them more consistent. Break the possible values for `--empty` into separate sections for readability. Alphabetical order is chosen for consistency. In a future commit, we'll be documenting a new `--empty` option for git-cherry-pick(1), making the consistency even more relevant. Signed-off-by: Brian Lyles <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0af3889 commit 64a443e

File tree

2 files changed

+29
-16
lines changed

2 files changed

+29
-16
lines changed

Documentation/git-am.txt

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,19 @@ OPTIONS
6666
--quoted-cr=<action>::
6767
This flag will be passed down to 'git mailinfo' (see linkgit:git-mailinfo[1]).
6868

69-
--empty=(stop|drop|keep)::
70-
By default, or when the option is set to 'stop', the command
71-
errors out on an input e-mail message lacking a patch
72-
and stops in the middle of the current am session. When this
73-
option is set to 'drop', skip such an e-mail message instead.
74-
When this option is set to 'keep', create an empty commit,
75-
recording the contents of the e-mail message as its log.
69+
--empty=(drop|keep|stop)::
70+
How to handle an e-mail message lacking a patch:
71+
+
72+
--
73+
`drop`;;
74+
The e-mail message will be skipped.
75+
`keep`;;
76+
An empty commit will be created, with the contents of the e-mail
77+
message as its log.
78+
`stop`;;
79+
The command will fail, stopping in the middle of the current `am`
80+
session. This is the default behavior.
81+
--
7682

7783
-m::
7884
--message-id::

Documentation/git-rebase.txt

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -289,17 +289,24 @@ See also INCOMPATIBLE OPTIONS below.
289289
+
290290
See also INCOMPATIBLE OPTIONS below.
291291

292-
--empty=(drop|keep|ask)::
292+
--empty=(ask|drop|keep)::
293293
How to handle commits that are not empty to start and are not
294294
clean cherry-picks of any upstream commit, but which become
295295
empty after rebasing (because they contain a subset of already
296-
upstream changes). With drop (the default), commits that
297-
become empty are dropped. With keep, such commits are kept.
298-
With ask, the rebase will halt when an empty commit is applied
299-
allowing you to choose whether to drop it, edit files more, or just
300-
commit the empty changes.
301-
When the `-i`/`--interactive` option is used, the default becomes ask.
302-
Otherwise, when the `--exec` option is used, the default becomes keep.
296+
upstream changes):
297+
+
298+
--
299+
`ask`;;
300+
The rebase will halt when the commit is applied, allowing you to
301+
choose whether to drop it, edit files more, or just commit the empty
302+
changes. This option is implied when `-i`/`--interactive` is
303+
specified.
304+
`drop`;;
305+
The commit will be dropped. This is the default behavior.
306+
`keep`;;
307+
The commit will be kept. This option is implied when `--exec` is
308+
specified unless `-i`/`--interactive` is also specified.
309+
--
303310
+
304311
Note that commits which start empty are kept (unless `--no-keep-empty`
305312
is specified), and commits which are clean cherry-picks (as determined
@@ -704,7 +711,7 @@ be dropped automatically with `--no-keep-empty`).
704711
Similar to the apply backend, by default the merge backend drops
705712
commits that become empty unless `-i`/`--interactive` is specified (in
706713
which case it stops and asks the user what to do). The merge backend
707-
also has an `--empty=(drop|keep|ask)` option for changing the behavior
714+
also has an `--empty=(ask|drop|keep)` option for changing the behavior
708715
of handling commits that become empty.
709716

710717
Directory rename detection

0 commit comments

Comments
 (0)