Re: Updated Kernel Hacker's guide to git

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/22/06, Junio C Hamano <junkio@xxxxxxx> wrote:
"Francis Moreau" <francis.moro@xxxxxxxxx> writes:

> I think this part is really confusing. For a new comer, saying that:
>
>       git diff a b == git diff a..b
>
> is really not intuitive. Maybe just because adding a new symbol ".."
> in git diff command line means (for me) that we're doing a special
> diff. I would never thought by my own that ".." means a simple "to".

We did not originally have "A B"; you were supposed to always
say "A..B".  But all other SCM had "A B" notation, so we added
support for both because doing so was trivial and there is no
risk of confusion (because diff is about two points while log is
about a set).  These two notations are interchangeable for
"diff".  If it confuses you, you can stick to the "git diff A B"
notation.  Of if you are like Linus, stick to "A..B" notation.
Either way, you can pretend that the other notation does not
even exist and be happy ;-).


no, no, I think you miss my point here. What is confusing, and it
seems I'm not the only one to find it confusing,  is the fact that
"git diff A B == git diff A..B", not the "A..B" notation per se.

git diff A B, is really intuitive and easy to understand because we
all use to using the diff "A B" notation and it always has worked with
2 endpoints. So I would bet that all newbies who use for the first
time the git diff command will use "A B" notation, not "A..B" one.

Yes, users often wondered why "git diff" accepts "A B", "git
log" wants "A..B" and "git log A B" is a disaster.  But the root
cause of the confusion was not about notation but about the
conceptual difference (two points vs a set).

I do not think changing the meaning of "diff A..B" to what "diff
A...B" means is a good thing.  The notation "..." even _looks_
like a magic, and in diff context, what it does _is_ magic (it
is magic in log context, too).  You are giving two points, but

But ".." is magic too ! I would really expect something magic to
happen when using the "A..B" notation because I'm a new comer in git
and I never used the "A..B" notation before.

And since I already used this notation when using git log command, I
would expect "git diff A..B" to give the current result given by "git
diff A...B".

But yes, now I have understand that git diff works with end points
unlike git log, I can stick with two notations:

       git diff A B
       git diff A...B (3 dots)

and I'm happy ;)

thanks
--
Francis
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]