Thread (9 messages) flat view 9 messages, 6 authors, 2016-06-15

Re: Confusion about diffing branches

From: Shawn Bohrer <hidden>
Date: 2016-06-15 22:43:31

On Sun, Aug 26, 2007 at 05:18:35PM -0700, Junio C Hamano wrote:
When you are working on topic it is often desired to see "what
have I done since I forked?" and "what have they done while I
was looking the other way?".
Absolutely, and from the user manual I gathered that this was what the
two-dot form was for.  "git diff master..topic" show me the diff of
commits reachable from topic, but not from master.

The three-dot form seemed to address the other use case which is
probably the more usual case for git-diff which is show me the changes
reachable from master or topic but not both.
"git diff master topic" (which is the same as "git diff
master..topic" -- the two-dot form is just a syntax sugar to
avoid mistypes for people who are too used to type two dots as
reflex because that is how you express a revision range) shows
a squashed diff that is A+B-E, and often people found "-E" part
distracting and useless.  Three-dot form was invented
specifically to address this problem.  You do not have to (and
you do not _want_ to) use that form if you _want_ to see the -E
part of the diff.
So if I understand you correctly people in the git world are simply more
used to typing two dots (instead of three) so that is why the two dot
notation shows the more common use case (show me the difference between
the tip of the master branch and the tip of the topic branch).

I must admit that for me, a new git user, it would be much more
intuitive if all git commands used the same syntax for specifying
revisions.  After all every other git command that I have used so far
uses the opposite syntax as git-diff.  This includes git-log,
git-format-patch, gitk, git-rev-list, and git-rev-parse.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help