Skip to content

Commit 497171e

Browse files
Peter EriksenJunio C Hamano
authored andcommitted
Documentation: --amend cannot be combined with -c/-C/-F.
We used to get the following confusing error message: $ git commit --amend -a -m foo Option -m cannot be combined with -c/-C/-F This is because --amend cannot be combined with -c/-C/-F, which makes sense, because they try to handle the same log message in different ways. So update the documentation to reflect this. Signed-off-by: Peter Eriksen <s022018@student.dtu.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 191453f commit 497171e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Documentation/git-commit.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ git-commit - Record changes to the repository
88
SYNOPSIS
99
--------
1010
[verse]
11-
'git-commit' [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>]
12-
[--no-verify] [--amend] [-e] [--author <author>]
11+
'git-commit' [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg> |
12+
--amend] [--no-verify] [-e] [--author <author>]
1313
[--] [[-i | -o ]<file>...]
1414

1515
DESCRIPTION

git-commit.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright (c) 2005 Linus Torvalds
44
# Copyright (c) 2006 Junio C Hamano
55

6-
USAGE='[-a] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit>] [-u] [--amend] [-e] [--author <author>] [[-i | -o] <path>...]'
6+
USAGE='[-a] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit> | --amend] [-u] [-e] [--author <author>] [[-i | -o] <path>...]'
77
SUBDIRECTORY_OK=Yes
88
. git-sh-setup
99
require_work_tree
@@ -284,9 +284,9 @@ esac
284284

285285
case "$log_given" in
286286
tt*)
287-
die "Only one of -c/-C/-F can be used." ;;
287+
die "Only one of -c/-C/-F/--amend can be used." ;;
288288
*tm*|*mt*)
289-
die "Option -m cannot be combined with -c/-C/-F." ;;
289+
die "Option -m cannot be combined with -c/-C/-F/--amend." ;;
290290
esac
291291

292292
case "$#,$also,$only,$amend" in

0 commit comments

Comments
 (0)