Skip to content

Commit 8bf14d6

Browse files
Petr BaudisJunio C Hamano
authored andcommitted
Document the --(no-)edit switch of git-revert and git-cherry-pick
This switch was not documented properly. I decided not to mention the --no-edit switch in the git-cherry-pick documentation since we always default to no editing. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 287f860 commit 8bf14d6

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

Documentation/git-cherry-pick.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ git-cherry-pick - Apply the change introduced by an existing commit.
77

88
SYNOPSIS
99
--------
10-
'git-cherry-pick' [-n] [-r] <commit>
10+
'git-cherry-pick' [--edit] [-n] [-r] <commit>
1111

1212
DESCRIPTION
1313
-----------
@@ -20,6 +20,10 @@ OPTIONS
2020
<commit>::
2121
Commit to cherry-pick.
2222

23+
--edit::
24+
With this option, `git-cherry-pick` will let you edit the commit
25+
message prior committing.
26+
2327
-r::
2428
Usually the command appends which commit was
2529
cherry-picked after the original commit message when

Documentation/git-revert.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ git-revert - Revert an existing commit.
77

88
SYNOPSIS
99
--------
10-
'git-revert' [-n] <commit>
10+
'git-revert' [--edit | --no-edit] [-n] <commit>
1111

1212
DESCRIPTION
1313
-----------
@@ -20,6 +20,15 @@ OPTIONS
2020
<commit>::
2121
Commit to revert.
2222

23+
--edit::
24+
With this option, `git-revert` will let you edit the commit
25+
message prior committing the revert. This is the default if
26+
you run the command from a terminal.
27+
28+
--no-edit::
29+
With this option, `git-revert` will not start the commit
30+
message editor.
31+
2332
-n::
2433
Usually the command automatically creates a commit with
2534
a commit log message stating which commit was reverted.

git-revert.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ esac
1919
usage () {
2020
case "$me" in
2121
cherry-pick)
22-
die "usage git $me [-n] [-r] <commit-ish>"
22+
die "usage git $me [--edit] [-n] [-r] <commit-ish>"
2323
;;
2424
revert)
25-
die "usage git $me [-n] <commit-ish>"
25+
die "usage git $me [--edit | --no-edit] [-n] <commit-ish>"
2626
;;
2727
esac
2828
}

0 commit comments

Comments
 (0)