Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH, properly formatted] git-commit: add a --interactive option

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:58

Paolo Bonzini [off-list ref] writes:
... Since
interactive stuff does not require backward compatibility in general,
I would ask to commit my patch anyway, assuming that in the future the
feature is rewritten to conform to the flow you indicate...
I think people feel changes to interactive workflow is a big
deal.
quoted hunk
diff --git a/git-commit.sh b/git-commit.sh
index be3677c..e8ec3b9 100755
--- a/git-commit.sh
+++ b/git-commit.sh
...
 esac
 unset only
+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,[1-9]*)
+	die "Paths with --interactive does not make sense." ;;
+,,t,0)
 	die "No paths with -i does not make sense." ;;
 esac
Clever.
quoted hunk
@@ -344,6 +352,9 @@ t,)
 	) || exit
 	;;
 ,)
+	if test "$interactive" = t; then
+		git add --interactive || exit
+	fi
 	case "$#" in
 	0)
 		;; # commit as-is
If we were to do this, we probably would want a way to exit
non-zero from "git-add -i", but I guess we can say we already
have that way via ^C.

Will queue for 'next', but it's getting late here so it probably
would not appear on the public repository tonight.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help