git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* On removing files and "git-rm is pointless"
@ 2006-12-02 17:05 Carl Worth
  2006-12-02 17:37 ` Linus Torvalds
  0 siblings, 1 reply; 16+ messages in thread
From: Carl Worth @ 2006-12-02 17:05 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 2150 bytes --]

Some people have recently asked questions about why we even have a
"git rm" command since it seems so pointless if you understand git's
model and "commit -a" well enough.

I wrote that command, so let me explain.

The problem I was trying to address is that a new user (me), was
trying to learn git and made it through a scenario like this:

	git init-db
	echo a > a
	git add a
	git commit

	"Cool, that works. Now let's explore file deletion:"

	rm file
	git commit

	"Hmm... that' didn't work, and git commit says:

		#   (use git-update-index to mark for commit)
		#
		#       deleted:    file

	I explored the documentation and found
	"git update-index --remove file" and thought, "this git system
	is insane! what a horrible command line that is!"

So, with "git commit", it doesn't work to just plain delete the file.

Now, a really cool thing about git and something that makes it easier
than other systems, (like cvs say), is that you don't _have_ to do
anything extra to tell it about file deletion, (nor file rename). But
to get the cool feature to work, you have to use "commit -a":

	rm file
	git commit -a

Is our new documentation going to lead users to discover this great
feature? We're talking about documenting "commit -a" as, "'add' all
tracked files then commit". It would take an exceptional stretch for a
new reader to take that sentence and realize that it would also mean
that any deleted file would also be removed from git's tracking. We're
using a verb with the _opposite_ meaning for crying out loud!

So, back to "git rm". I added it not just because some people might be
trained to tell the SCM about file removal. I added it to make "git
commit" seem more reliable, (since it can feel broken to new
users---it doesn't seem 'smart' enough to just figure out what changes
have been made to files that are being tracked).

So we should show the "smarter" behavior to users by default. Then
"git commit" wouldn't feel broken. We could even throw away "git rm"
and use its absence as a selling point for git. "Hey, git's actually
_easier_ to use than that broken stuff you've been using."

Wouldn't that be great?

-Carl




[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2006-12-05  5:43 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).