@matheusbsbs / matheus-bagliano / commits / 4170a19587
Fork 0

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>

Junio C Hamano committed Feb 12, 2006 at 23:55 UTC 4170a19587280eeb3663a47a6fd993910de78076
2 files changed +14 -12
Documentation/git-commit.txt
+11 -6
@@ -8,8 +8,8 @@ git-commit - Record your changes
8 SYNOPSIS
9 --------
10 [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>...]
13
14 DESCRIPTION
15 -----------
@@ -73,15 +73,20 @@ OPTIONS
73 commit the whole index. This is the traditional
74 behaviour.
75
76 ---::
77 - Do not interpret any more arguments as options.
78 -
79 -<file>...::
76 +-o|--only::
77 Commit only the files specified on the command line.
78 This format cannot be used during a merge, nor when the
79 index and the latest commit does not match on the
80 specified paths to avoid confusion.
81
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 +
90 If you make a commit and then found a mistake immediately after
91 that, you can recover from it with gitlink:git-reset[1].
92
git-commit.sh
+3 -6
@@ -3,7 +3,7 @@
3 # Copyright (c) 2005 Linus Torvalds
4 # Copyright (c) 2006 Junio C Hamano
5
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>...]'
7 SUBDIRECTORY_OK=Yes
8 . git-sh-setup
9
@@ -340,11 +340,8 @@ case "$#,$also$only" in
340 0,)
341 ;;
342 *,)
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=
345
346 # If we are going to launch an editor, the message won't be
347 # shown without this...