Thread (4 messages) flat view 4 messages, 2 authors, 2016-06-15

[PATCH/RFC] Allow file removal when "git commit --all" is used.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:04
Subsystem: the rest · Maintainer: Linus Torvalds

After you deleted files from your working tree, automatic
git-update-cache used when the "--all" flag is given to "git
commit" barfs because it lacks the --remove flag.

It can be argued that this is a feature; people should be
careful and something with a grave consequence like removing
files should be done manually, in which case the current
behaviour may be OK.

The patch is for people who thinks the user who uses the "--all"
flag deserves the danger that comes with the convenience.

Comments?

Signed-off-by: Junio C Hamano <redacted>
---
diff --git a/git-commit-script b/git-commit-script
--- a/git-commit-script
+++ b/git-commit-script
@@ -88,13 +88,13 @@ esac
 case "$all,$#" in
 t,*)
 	git-diff-files --name-only -z |
-	xargs -0 git-update-cache -q --
+	xargs -0 git-update-cache -q --remove --
 	;;
 ,0)
 	;;
 *)
 	git-diff-files --name-only -z "$@" |
-	xargs -0 git-update-cache -q --
+	xargs -0 git-update-cache -q --remove --
 	;;
 esac || exit 1
 git-update-cache -q --refresh || exit 1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help