From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carl Worth Subject: Re: my git problem Date: Wed, 30 Apr 2008 23:01:32 -0700 Message-ID: <871w4mwojn.wl%cworth@cworth.org> References: <20080427112938.4dbe8e2a.akpm@linux-foundation.org> <20080427124454.6a606305.akpm@linux-foundation.org> <20080428114509.240ef4ae.akpm@linux-foundation.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Wed_Apr_30_23:01:19_2008-1"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Cc: Andrew Morton , git@vger.kernel.org To: Linus Torvalds X-From: git-owner@vger.kernel.org Thu May 01 08:21:15 2008 connect(): Connection refused Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1JrSAL-0002Ke-FW for gcvg-git-2@gmane.org; Thu, 01 May 2008 08:21:13 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751523AbYEAGU0 (ORCPT ); Thu, 1 May 2008 02:20:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752825AbYEAGU0 (ORCPT ); Thu, 1 May 2008 02:20:26 -0400 Received: from olra.theworths.org ([82.165.184.25]:58645 "EHLO olra.theworths.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751009AbYEAGUZ (ORCPT ); Thu, 1 May 2008 02:20:25 -0400 X-Greylist: delayed 1111 seconds by postgrey-1.27 at vger.kernel.org; Thu, 01 May 2008 02:20:25 EDT Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 62953431FDF; Wed, 30 Apr 2008 23:01:53 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J8-A6BWLvTNt; Wed, 30 Apr 2008 23:01:52 -0700 (PDT) Received: from raht.cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id A7DDB431FDD; Wed, 30 Apr 2008 23:01:51 -0700 (PDT) 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 List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: --pgp-sign-Multipart_Wed_Apr_30_23:01:19_2008-1 Content-Type: text/plain; charset=US-ASCII On Mon, 28 Apr 2008 12:21:17 -0700 (PDT), Linus Torvalds wrote: > On Mon, 28 Apr 2008, Andrew Morton wrote: > > I'd have expected git-log to operate on the same patches as git-diff. > > No, not at all. > > - "git log" shows each commit in a range. > > - "git diff" shows just the difference between two states. > > The two have nothing in common. One operates on lots of individual commits > (git log) individually, while the other one fundamentally operates on just > two end-points (git diff). Yes, the two operations are internally operating on different things, (exactly as described). > And "a..b" and "a...b" means two totally different things for the two > totally different operations. But the internal difference doesn't justify the totally different meaning of "a..b" and "a...b" for these two operations. And in the rest of your message you didn't justify the difference at all, (just the fact that there *can* be a difference). As a concrete example, I often want to view a series of patches that is unique to a branch. I can easily do that with: git log -p a..b Now, if I want to view basically the same information, but in a "combined" view, (a single patch from the beginning to the final state), I have to instead do: git diff a...b And that's the part that's really confusing people, I think, (see Andrew Morton running into the problem here, and Havoc Pennington elsewhere). Conceptually, "a..b" is a way to say "the commits that are unique to 'b' compared to 'a'", and that works great for git-log. But when a similar concept is often desired for git-diff it's spelled "a...b" instead. What's the justification for that? (Other than historical accident.) Meanwhile, you could even point to a similar case with the opposite forms of each command. That is, one can see a series of patches with: git log -p a...b And again, one can get get basically the same information in a combined, single-patch form with: git diff a..b or: git diff b..a depending on which direction one would like the combined version to be in. Again, why the opposite syntax for basically the same information? So git-log and git-diff are consistent in not treating the ".." and "..." syntax uniformly, but I can't see any good justification for that. I don't think this second case is causing much problem. The symmetric difference that's described by "git log a...b" isn't something I end up needing very often, anyway. Meanwhile, a single patch between two arbitrary states is extremely common, but I've always expressed that naturally as "git diff a b", (by analogue with good old "diff fileA fileB"), and never felt a need to spell this command as "git diff a..b". So, I do think the handling of ".." and "..." in git-diff is objectively backwards compared to the way that git-log, git-rev-list and everything else treat these operators. I don't know what can be done to fix this now, though. Just expect users to get confused, and then try to get them to drill "git log a..b" and "git diff a...b" into their wee little brains. Or maybe go Elijah's route and invent a new top-level command name in which issues like this can get fixed. (I've been lukewarm on the idea after watching the cogito attempt eventually be abandoned. I'd really much rather see Elijah's ideas get pushed down into git itself for the most part. But it's tough when backwards-compatibility prevents fixing some things that are obviously confusing people.) -Carl --pgp-sign-Multipart_Wed_Apr_30_23:01:19_2008-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBIGVy76JDdNq8qSWgRAvVdAJ9zdV5mCWk3fm2JFFiePPpZeGSY4gCgn/FA 0/dj3/6q2f5AWIIKHo7k8yg= =e03J -----END PGP SIGNATURE----- --pgp-sign-Multipart_Wed_Apr_30_23:01:19_2008-1--