From: Linus Torvalds <torvalds@osdl.org>
To: Junio C Hamano <junkio@cox.net>
Cc: Nicolas Pitre <nico@cam.org>,
git@vger.kernel.org, Carl Worth <cworth@cworth.org>,
Sam Vilain <sam@vilain.net>
Subject: Re: On removing files and "git-rm is pointless"
Date: Mon, 4 Dec 2006 07:42:26 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.64.0612040737120.3476@woody.osdl.org> (raw)
In-Reply-To: <7vd570q888.fsf@assigned-by-dhcp.cox.net>
On Mon, 4 Dec 2006, Junio C Hamano wrote:
>
> FWIW, I too am in favor of the proposed fix to "git rm" as Linus
> outlined.
Note that somebody (sorry, forget who) correctly pointed out that in order
to be "safe", the file that you "rm" has to match not only the index, but
it should match the HEAD tree too.
If it matches both the index and the HEAD tree, a "git rm filename" is
totally safe, since you can always get it back by just doing a
git checkout HEAD filename
so the "git rm" really didn't lose any info, and as such, we can _happily_
remove the working tree copy without any concern at all.
If it doesn't match HEAD, we can't get it back as easily, so maybe that's
the case when we want to have "git rm -f filename".
(And obviously, for all the normal reasons, if the index or HEAD doesn't
match, the error message should be helpful and also explicitly mention the
"-f" flag. Somehing like
file 'x' does not match HEAD or has been staged for changes.
Will not remove. Use '-f' to force removal.
("has been staged for changes" is just a long way of saying "index". See?
I _can_ learn.)
next prev parent reply other threads:[~2006-12-04 15:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-02 17:05 On removing files and "git-rm is pointless" Carl Worth
2006-12-02 17:37 ` Linus Torvalds
2006-12-02 20:00 ` Sam Vilain
2006-12-03 3:50 ` Nicolas Pitre
2006-12-04 10:13 ` Junio C Hamano
2006-12-04 10:48 ` Jakub Narebski
2006-12-04 15:42 ` Linus Torvalds [this message]
2006-12-04 16:03 ` Jakub Narebski
2006-12-04 16:04 ` Olivier Galibert
2006-12-05 1:08 ` Junio C Hamano
2006-12-05 3:29 ` Nicolas Pitre
2006-12-05 3:44 ` Carl Worth
2006-12-05 5:43 ` Junio C Hamano
2006-12-02 20:59 ` Horst H. von Brand
2006-12-02 21:10 ` Sam Vilain
2006-12-02 21:33 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0612040737120.3476@woody.osdl.org \
--to=torvalds@osdl.org \
--cc=cworth@cworth.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=nico@cam.org \
--cc=sam@vilain.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).