Re: Fwd: [RFC/FR] Should "git checkout (-B|-b) branch master...branch" work?

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

 



> Off topic: I also find it hard to wrap my head around what diffing
> against a negative revision would mean. Looking at the result of
> running it, it seems to be the same as diffing against a positive one.

That is not an off-topic at all, but is the crux of "diff A..B" being
a hysterical raisins.
It is parsed as and converted to "diff ^A B" by the revision command
line parser in
setup_revisions(), and the caller *guesses* what the command line
originally said by
inspecting that there are two revs in rev.pending[] array, the first
one is negative and
the second one is positive, to infer that the user typed "diff A..B"
and then finally
decides to compare A and B.

This was done before we introduced rev.cmdline_info to record what was
given from
the command line to result in the set of commits in rev.pending array.
If we were
writing "git diff" UI from scratch today, we wouldn't be looking at
rev.pending but
would be looking at rev.cmdline_info and we can differenciate between
"A B", "^A B",
and "A..B" (and reject the latter two as nonsense).
--
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]