Skip to content

Commit 64491e1

Browse files
author
Junio C Hamano
committed
Documentation: git-commit in 1.2.X series defaults to --include.
The documentation was mistakenly describing the --only semantics to be default. The 1.2.0 release and its maintenance series 1.2.X will keep the traditional --include semantics as the default. Clarify the situation. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent bd9ca0b commit 64491e1

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

Documentation/git-commit.txt

Lines changed: 27 additions & 7 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,19 +73,39 @@ 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 `--include` 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

8893

94+
WARNING
95+
-------
96+
97+
The 1.2.0 and its maintenance series 1.2.X will keep the
98+
traditional `--include` semantics as the default when neither
99+
`--only` nor `--include` is specified and `paths...` are given.
100+
This *will* change during the development towards 1.3.0 in the
101+
'master' branch of `git.git` repository. If you are using this
102+
command in your scripts, and you depend on the traditional
103+
`--include` semantics, please update them to explicitly ask for
104+
`--include` semantics. Also if you are used to making partial
105+
commit using `--include` semantics, please train your fingers to
106+
say `git commit --include paths...` (or `git commit -i paths...`).
107+
108+
89109
Discussion
90110
----------
91111

@@ -101,7 +121,7 @@ even the command is invoked from a subdirectory.
101121
That is, update the specified paths to the index and then commit
102122
the whole tree.
103123

104-
`git commit paths...` largely bypasses the index file and
124+
`git commit --only paths...` largely bypasses the index file and
105125
commits only the changes made to the specified paths. It has
106126
however several safety valves to prevent confusion.
107127

0 commit comments

Comments
 (0)