From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carl Worth Subject: Re: Updated Kernel Hacker's guide to git Date: Thu, 21 Dec 2006 17:23:15 -0800 Message-ID: <87slf83erg.wl%cworth@cworth.org> References: <38b2ab8a0612210424o4ec5fcd5kb5086c52ccd76491@mail.gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Thu_Dec_21_17:22:56_2006-1"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Cc: Francis Moreau , Jay Cliburn , git@vger.kernel.org, Jeff Garzik X-From: git-owner@vger.kernel.org Fri Dec 22 02:24:59 2006 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by dough.gmane.org with esmtp (Exim 4.50) id 1GxZ9Y-0007FL-SQ for gcvg-git@gmane.org; Fri, 22 Dec 2006 02:24:53 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1945901AbWLVBYp (ORCPT ); Thu, 21 Dec 2006 20:24:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1945902AbWLVBYp (ORCPT ); Thu, 21 Dec 2006 20:24:45 -0500 Received: from cworth.org ([217.160.249.188]:42869 "EHLO theworths.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1945901AbWLVBYo (ORCPT ); Thu, 21 Dec 2006 20:24:44 -0500 Received: (qmail 25511 invoked from network); 21 Dec 2006 20:24:42 -0500 Received: from localhost (HELO raht.cworth.org) (127.0.0.1) by localhost with SMTP; 21 Dec 2006 20:24:42 -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_Dec_21_17:22:56_2006-1 Content-Type: text/plain; charset=US-ASCII On Thu, 21 Dec 2006 10:23:30 -0800 (PST), Linus Torvalds wrote: > In short, for git diff (and ONLY) git diff, all of these are the same: > > git diff a..b > git diff a b I admit that I had had never passed a range of commits to git diff, nor even given any thought to what it might do, but I definitely find the above very surprising---and not necessarily very useful. Why is anyone ever typing those two dots here if they have no effect on the result? > It basically all boils down to: > > "git diff" is special > > exactly because unlike almost ALL other git commands, "git diff" does not > work on a _list_ of commits, it only works on two end-points. That means > that the "list operations" actually end up meaning something else for git > diff than they do for "git log" and friends. Yes, "git diff" can only work on two end points. So a command like: git diff a b is really easy to understand. And if the user wants to compare those two points, why would the user ever provide them with any other syntax? In other words, what's the advantage of "git diff" accepting a special syntax for a range ("a..b") and yet not actually doing anything special with it? In particular, the operation that would be interesting here is what one can get with: git diff $(git merge-base a b) b so why isn't _that_ the operation that is accessed with the syntax of: git diff a..b Said another way, if "git log a..b" displays a range of commits, why doesn't "git diff a..b" display the diff from the beginning of that range to the end? Of course, all the warnings you gave about what "git diff" would do in the case of various criss-cross merge scenarios would still apply. -Carl --pgp-sign-Multipart_Thu_Dec_21_17:22:56_2006-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQBFizOC6JDdNq8qSWgRAokGAJ42XV7EFgkTw7FKuNgr1U2dkge+WgCfZyVV 3VdAwURU8gkip43U9Obv29U= =R6Yx -----END PGP SIGNATURE----- --pgp-sign-Multipart_Thu_Dec_21_17:22:56_2006-1--