From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.176.0/21 X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 From: Carl Worth Subject: On removing files and "git-rm is pointless" Date: Sat, 02 Dec 2006 09:05:16 -0800 Message-ID: <87odqm2ppv.wl%cworth@cworth.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Sat_Dec__2_09:05:16_2006-1"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit NNTP-Posting-Date: Sat, 2 Dec 2006 17:06:05 +0000 (UTC) Return-path: Envelope-to: gcvg-git@gmane.org User-Agent: Wanderlust/2.14.0 (Africa) Emacs/21.4 Mule/5.0 (SAKAKI) Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GqYJP-0006fP-3h for gcvg-git@gmane.org; Sat, 02 Dec 2006 18:06:03 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424221AbWLBRGA (ORCPT ); Sat, 2 Dec 2006 12:06:00 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1424226AbWLBRGA (ORCPT ); Sat, 2 Dec 2006 12:06:00 -0500 Received: from cworth.org ([217.160.249.188]:20881 "EHLO theworths.org") by vger.kernel.org with ESMTP id S1424221AbWLBRF7 (ORCPT ); Sat, 2 Dec 2006 12:05:59 -0500 Received: (qmail 2229 invoked from network); 2 Dec 2006 12:05:54 -0500 Received: from localhost (HELO raht.cworth.org) (127.0.0.1) by localhost with SMTP; 2 Dec 2006 12:05:54 -0500 To: git@vger.kernel.org Sender: git-owner@vger.kernel.org --pgp-sign-Multipart_Sat_Dec__2_09:05:16_2006-1 Content-Type: text/plain; charset=US-ASCII 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 --pgp-sign-Multipart_Sat_Dec__2_09:05:16_2006-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQBFcbJM6JDdNq8qSWgRAgMiAJ9facITA9zPjN7WEEuOaj1DgjH9UACgmIlQ uVQ40aTpS9sspVJGhKZZmb0= =kpSN -----END PGP SIGNATURE-----