threads / rfc / 1567

RFC patchAllow file removal when "git commit --all" is used.

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

## tl;dr

4 messages between Aug 18, 2005 and Aug 19, 2005. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

Junio C Hamano· Aug 18, 2005, 07:59 UTC · lore

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 <junkio@cox.net>
---
Show changes to git-commit-script +2 −2
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
Johannes Schindelin· Aug 18, 2005, 10:49 UTC · re: Junio C Hamano · lore

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

Hi,
On Thu, 18 Aug 2005, Junio C Hamano wrote:
Show 13 quoted lines
> 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?

This is a sane default behaviour. Maybe introduce yet another flag "--no-remove", which says that removes should not be performed? But then, "--all" is mostly used by lazy people, who probably expect the removes to take place.

Ciao, Dscho

Junio C Hamano· Aug 19, 2005, 01:04 UTC · re: Johannes Schindelin · lore

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

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 9 quoted lines
>> The patch is for people who thinks the user who uses the "--all"
>> flag deserves the danger that comes with the convenience.
>> 
>> Comments?
>
> This is a sane default behaviour. Maybe introduce yet another flag 
> "--no-remove", which says that removes should not be performed? But then, 
> "--all" is mostly used by lazy people, who probably expect the removes to 
> take place.

Well, let's refrain from using that word; I am one of the "lazy" people, but I do that on purpose and from principle, not from lazyness. http://members.cox.net/junkio/per-file-commit.txt.

Johannes Schindelin· Aug 19, 2005, 08:06 UTC · re: Junio C Hamano · lore

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

Hi,
On Thu, 18 Aug 2005, Junio C Hamano wrote:
Show 15 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> >> The patch is for people who thinks the user who uses the "--all"
> >> flag deserves the danger that comes with the convenience.
> >> 
> >> Comments?
> >
> > This is a sane default behaviour. Maybe introduce yet another flag 
> > "--no-remove", which says that removes should not be performed? But then, 
> > "--all" is mostly used by lazy people, who probably expect the removes to 
> > take place.
> 
> Well, let's refrain from using that word; I am one of the "lazy"
> people, but I do that on purpose and from principle, not from
> lazyness.  http://members.cox.net/junkio/per-file-commit.txt.
Sorry, when I say "lazy people" I mean "yours truly".

Ciao, Dscho

← back to recent threads