Re: git-rm isn't the inverse action of git-add
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 3, 2007, 04:47 UTC
- Message-ID
- <7vhcomt7oa.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20070703041241.GA4007@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> H I W | ok? | why? > --------------------------------------------------- > N A N | ? | currently ok, but 'A' recoverable only through fsck > A B N | ? | currently ok, but 'B' recoverable only through fsck
These were explicitly done per request from git-rm users (myself not one of them) who wanted to:
rm the-file
git rm the-filesequence not to barf. I suspect they were from CVS background who are used to the SCM that complains if you still have the file in the working tree when you say "scm rm".
I would not mind requiring -f for these cases.
Show 9 quoted lines
> With --cached on, it is a little different: > > H I W | ok? | why? > --------------------------------------------------- > N A N | ? | currently ok, but 'A' recoverable only through fsck > N A A | ? | currently not ok, but 'A' still available in W > A A B | ? | currently not ok, but 'A' still available in H > A B N | ? | currently ok, but 'B' recoverable only through fsck > A B B | ? | currently not ok, but 'B' still available in W
I personally do not think we would need any safety check for "git rm --cached", as it does not touch the working tree. If one cares about the differences among three states, one would not issue "rm --cached" anyway. The only reason "rm --cached" is used is because one _knows_ that any blob should not exist at that path in the index.