Skip to content

Commit 4170a19

Browse files
author
Junio C Hamano
committed
git-commit: Now --only semantics is the default.
This changes the "git commit paths..." to default to --only semantics from traditional --include semantics, as agreed on the list. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent bd9ca0b commit 4170a19

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

Documentation/git-commit.txt

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

1414
DESCRIPTION
1515
-----------
@@ -73,15 +73,20 @@ OPTIONS
7373
commit the whole index. This is the traditional
7474
behaviour.
7575

76-
--::
77-
Do not interpret any more arguments as options.
78-
79-
<file>...::
76+
-o|--only::
8077
Commit only the files specified on the command line.
8178
This format cannot be used during a merge, nor when the
8279
index and the latest commit does not match on the
8380
specified paths to avoid confusion.
8481

82+
--::
83+
Do not interpret any more arguments as options.
84+
85+
<file>...::
86+
Files to be committed. The meaning of these is
87+
different between `--include` and `--only`. Without
88+
either, it defaults `--only` semantics.
89+
8590
If you make a commit and then found a mistake immediately after
8691
that, you can recover from it with gitlink:git-reset[1].
8792

git-commit.sh

Lines changed: 3 additions & 6 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] [-i] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit>] [-e] [--author <author>] [<path>...]'
6+
USAGE='[-a] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit>] [-e] [--author <author>] [[-i | -o] <path>...]'
77
SUBDIRECTORY_OK=Yes
88
. git-sh-setup
99

@@ -340,11 +340,8 @@ case "$#,$also$only" in
340340
0,)
341341
;;
342342
*,)
343-
echo >&2 "assuming --include paths..."
344-
also=t
345-
# Later when switch the defaults, we will replace them with these:
346-
# echo >&2 "assuming --only paths..."
347-
# also=
343+
echo >&2 "assuming --only paths..."
344+
also=
348345

349346
# If we are going to launch an editor, the message won't be
350347
# shown without this...

0 commit comments

Comments
 (0)