summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bd1fc62)
raw | patch | inline | side by side (parent: bd1fc62)
author | Paolo Bonzini <paolo.bonzini@lu.unisi.ch> | |
Mon, 5 Mar 2007 07:57:53 +0000 (08:57 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 9 Mar 2007 08:05:23 +0000 (00:05 -0800) |
The --interactive option behaves like "git commit", except that
"git add --interactive" is executed before committing. It is
incompatible with -a and -i.
Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
"git add --interactive" is executed before committing. It is
incompatible with -a and -i.
Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-commit.txt | patch | blob | history | |
git-commit.sh | patch | blob | history |
index 2187eee4164038346ed7a3ae32f563aeb74f23f7..53a7bb0895036e4d66086b8c656e74588c82c38c 100644 (file)
SYNOPSIS
--------
[verse]
-'git-commit' [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg> |
- --amend] [--no-verify] [-e] [--author <author>]
+'git-commit' [-a | --interactive] [-s] [-v]
+ [(-c | -C) <commit> | -F <file> | -m <msg> | --amend]
+ [--no-verify] [-e] [--author <author>]
[--] [[-i | -o ]<file>...]
DESCRIPTION
before, and to automatically "rm" files that have been
removed from the working tree, and perform the actual commit.
+5. by using the --interactive switch with the 'commit' command to decide one
+ by one which files should be part of the commit, before finalizing the
+ operation. Currently, this is done by invoking `git-add --interactive`.
+
The gitlink:git-status[1] command can be used to obtain a
summary of what is included by any of the above for the next
commit by giving the same set of parameters you would give to
diff --git a/git-commit.sh b/git-commit.sh
index b8c00b823656f36f6a6f38493b9569831db713b1..3656d607d5b91d8d125b5a72b6a2a00aee512618 100755 (executable)
--- a/git-commit.sh
+++ b/git-commit.sh
# Copyright (c) 2005 Linus Torvalds
# Copyright (c) 2006 Junio C Hamano
-USAGE='[-a] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit> | --amend] [-u] [-e] [--author <author>] [[-i | -o] <path>...]'
+USAGE='[-a | --interactive] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit> | --amend] [-u] [-e] [--author <author>] [[-i | -o] <path>...]'
SUBDIRECTORY_OK=Yes
. git-sh-setup
require_work_tree
all=
also=
+interactive=
only=
logfile=
use_commit=
also=t
shift
;;
+ --int|--inte|--inter|--intera|--interac|--interact|--interacti|\
+ --interactiv|--interactive)
+ interactive=t
+ shift
+ ;;
-o|--o|--on|--onl|--only)
only=t
shift
;;
esac
unset only
-case "$all,$also,$#" in
-t,t,*)
- die "Cannot use -a and -i at the same time." ;;
+case "$all,$interactive,$also,$#" in
+*t,*t,*)
+ die "Cannot use -a, --interactive or -i at the same time." ;;
t,,[1-9]*)
die "Paths with -a does not make sense." ;;
-,t,0)
+,t,[1-9]*)
+ die "Paths with --interactive does not make sense." ;;
+,,t,0)
die "No paths with -i does not make sense." ;;
esac
) || exit
;;
,)
+ if test "$interactive" = t; then
+ git add --interactive || exit
+ fi
case "$#" in
0)
;; # commit as-is