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: Re: [PATCH 0/2] Making "git commit" to mean "git commit -a". Date: Thu, 30 Nov 2006 16:13:24 -0800 Message-ID: <873b80tqvv.wl%cworth@cworth.org> References: <7virgzuf38.fsf@assigned-by-dhcp.cox.net> <7vr6vmsnly.fsf@assigned-by-dhcp.cox.net> <87ejrlvn7r.wl%cworth@cworth.org> <7vodqpn3t4.fsf@assigned-by-dhcp.cox.net> <7vk61dn2yj.fsf@assigned-by-dhcp.cox.net> <456EBBE7.8030404@op5.se> <20061130164046.GB17715@thunk.org> <87irgwu6e6.wl%cworth@cworth.org> <87hcwgu5t1.wl%cworth@cworth.org> <7vhcwgiqer.fsf@assigned-by-dhcp.cox.net> <7vlklsfsgz.fsf@assigned-by-dhcp.cox.net> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Thu_Nov_30_16:13:24_2006-1"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit NNTP-Posting-Date: Fri, 1 Dec 2006 00:14:45 +0000 (UTC) Cc: Junio C Hamano , Nicolas Pitre , Theodore Tso , Andreas Ericsson , Johannes Schindelin , git@vger.kernel.org Return-path: Envelope-to: gcvg-git@gmane.org In-Reply-To: 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 1Gpw2k-0002zO-H4 for gcvg-git@gmane.org; Fri, 01 Dec 2006 01:14:22 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031631AbWLAAOP (ORCPT ); Thu, 30 Nov 2006 19:14:15 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1031632AbWLAAOP (ORCPT ); Thu, 30 Nov 2006 19:14:15 -0500 Received: from mx1.redhat.com ([66.187.233.31]:51396 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S1031631AbWLAAOO (ORCPT ); Thu, 30 Nov 2006 19:14:14 -0500 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id kB10E4lo024898; Thu, 30 Nov 2006 19:14:04 -0500 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.76.12]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id kB10E453022657; Thu, 30 Nov 2006 19:14:04 -0500 Received: from raht.cworth.org (sebastian-int.corp.redhat.com [172.16.52.221]) by mail.boston.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id kB10E2AL025810; Thu, 30 Nov 2006 19:14:02 -0500 To: Linus Torvalds Sender: git-owner@vger.kernel.org --pgp-sign-Multipart_Thu_Nov_30_16:13:24_2006-1 Content-Type: text/plain; charset=US-ASCII On Thu, 30 Nov 2006 15:40:58 -0800 (PST), Linus Torvalds wrote: > I like the fact that when you do "git commit filename", it really will > commit _only_ that file, not the other files you added. It's logical. > > So you can do > > echo a > file-a > echo b > file-b > git add file-a file-b > > git commit file-a But, wait a second. What if I do my typo fix to file-a in between that "git add" and the "git commit". Why should "git commit" insist so vehemently on committing the _old_ state of file-a while "git commit file-a" so happily commits the _new_ state? I'm really not seeing conceptual consistency to what "commit " does compared to "commit". The "commit " case is a special-case of "commit -a" while "commit" is just plain different. See? I do like the direction Nico is going with "git add" and his little tutorial. I think the first part of that, (without the twists), could make a very nice introduction to git. The "twists" part though is quite a nightmare, and "twists on twists" is something that should be left to B-grade screenwriters, not technical writers, (nothing against Nico there---the stuff is really confusing). But dropping back to the old default for "git commit explicit/file" really would only make things worse. > - "git commit" on its own: > > This is for things where you prepared things earlier: notably a merge, > for example. For "notably a merge", how often is this not equivalent to "commit -a" in your view? > But it might be the "--amend" case too, where you simply > don't want to change any of the working tree, just the commit message. Personally, I think I use --amend to change the tree of the last commit as often as I change just the message. Regardless of the relative frequency, I definitely use it often for both of those modes, so both should be supported. > - "git commit explicit/file anotherfile" > > This is great (and I use it) exactly for when you have random other > additions in your tree that are brewing, and you just want to commit a > particular fix that takes precedence. As I mention above, this usage is exactly "commit -a" but restricted to just a few paths. Why isn't it just as brain-damaged to take contents from the working tree instead of the index here as in the case of my "add; fix typo; commit" example? > - "git commit -a" > > Sure, this is the common case, but just how painful is it to type those > extra few characters? If we all agree it's the most common, then why isn't it the default?! It's the right thing for after resolving a conflicted merge, (since the working tree is where the user _first_ resolves things, before the changes make it to the index), the command is consistent with the behavior of "git commit explicit/file", and the existing "git commit" behavior would still be available in the rare cases it's desired, (and then, how painful would it be to type the few extra characters to ask for that?). I know, I know. I said I'd give up and yet I keep harping on this stuff. I'm hopeless. -Carl --pgp-sign-Multipart_Thu_Nov_30_16:13:24_2006-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQBFb3Ok6JDdNq8qSWgRAuccAJ9eah6ZePq0ZTfjOLbDtwQYVCyqDwCfbsYg 3KRw9tfXx8AlHUQDe1BLeqI= =ctQs -----END PGP SIGNATURE-----