From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carl Worth Subject: Re: Two crazy proposals for changing git's diff commands Date: Thu, 09 Feb 2006 15:07:10 -0800 Message-ID: <87d5hwxhb5.wl%cworth@cworth.org> References: <87slqtcr2f.wl%cworth@cworth.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Thu_Feb__9_15:07:04_2006-1"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Cc: git@vger.kernel.org X-From: git-owner@vger.kernel.org Fri Feb 10 00:08:38 2006 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F7Kti-0000M1-KT for gcvg-git@gmane.org; Fri, 10 Feb 2006 00:08:22 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750808AbWBIXIG (ORCPT ); Thu, 9 Feb 2006 18:08:06 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750783AbWBIXIG (ORCPT ); Thu, 9 Feb 2006 18:08:06 -0500 Received: from theworths.org ([217.160.253.102]:19435 "EHLO theworths.org") by vger.kernel.org with ESMTP id S1750808AbWBIXIE (ORCPT ); Thu, 9 Feb 2006 18:08:04 -0500 Received: (qmail 8562 invoked from network); 9 Feb 2006 18:08:03 -0500 Received: from localhost (HELO raht.localdomain) (127.0.0.1) by localhost with SMTP; 9 Feb 2006 18:08:03 -0500 To: Linus Torvalds In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) Emacs/21.4 Mule/5.0 (SAKAKI) Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: --pgp-sign-Multipart_Thu_Feb__9_15:07:04_2006-1 Content-Type: text/plain; charset=US-ASCII On Wed, 8 Feb 2006 17:21:49 -0800 (PST), Linus Torvalds wrote: > > > > The largest reason for why "git diff" defaults to diffing against the > > index (and not head) is _literally_ that it's faster. That's certainly surprising history to learn. > Btw, it was kind of luck (but it's definitely true) that the current "git > diff" semantics happen to also be what you do want during merges when you > try to resolve a conflict (while "git diff HEAD" is much less useful). > > So making "git diff" default to diffing against HEAD is actually the wrong > thing to do during merging, where the current behaviour is exactly what > you'd want. I discovered this during the analysis and guess (incorrectly) that it was the motivation for the behavior of "git diff". Initially I think I would have made a proposal that had "git diff" creating a diff from HEAD except that I discovered two different targets that would be useful when diffing from HEAD: HEAD -> index and: HEAD -> files so I chose "index" and "files" as the naming distinction there. In light of those, I couldn't think of any good naming for the remaining: index -> files operation, so it seemed just as well to leave it with a bare "diff" as before. But, as you've pointed out, my trying to create new high-level diff-index and diff-files operations fails in that it clashes with the existing low-level uses of those names, (which scripts may already be depending on). I totally neglected to consider the pain of migrating scripts. I still think the three above operations are the most commonly needed, but I don't yet have good suggestions for names for them. I think I'll be back with some new proposals after considering your suggestion to expand git status. -Carl --pgp-sign-Multipart_Thu_Feb__9_15:07:04_2006-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBD68se6JDdNq8qSWgRAlyGAJ4+1vdCZY3Az5xQC8Q+//jVJjtaGQCfWzWf up18vY/YHw82qHsdpjLh4dA= =R6Wj -----END PGP SIGNATURE----- --pgp-sign-Multipart_Thu_Feb__9_15:07:04_2006-1--