Re: [PATCH] git-diff: Add --staged as a synonym for --cached.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 12, 2008, 23:42 UTC
- Message-ID
- <7vk5b8ldfb.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <32541b130811121439tbfc54aeq2999dbebf149d5bc@mail.gmail.com>
"Avery Pennarun" <apenwarr@gmail.com> writes:
> I assume the reason is that "git diff tree1..tree2" works with the > differences between tree1 and tree2, much like "git log tree1..tree2" > does.
Actually, that perception is already confused. The analogue to "log A..B" is expressed as "diff A...B", and not "diff A..B".
That is one of the reasons why I tend to teach against using "diff A..B" unless you know what it is doing. I'd suggest to get out of that habit before you confuse yourself even more ;-).
The _only_ reason diff takes A..B and A...B syntax is because the command line parameter parser was easy to write that way. IOW, it was an artifact of the implementation convenience.