Re: [PATCH] git-diff: Add --staged as a synonym for --cached.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 11, 2008, 01:11 UTC
- Message-ID
- <7vljvr2hjn.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <ee77f5c20811101537u6061e5b4w420e9692e0cefad3@mail.gmail.com>
"David Symonds" <dsymonds@gmail.com> writes:
Show 10 quoted lines
> On Mon, Nov 3, 2008 at 6:14 PM, Jeff King <peff@peff.net> wrote: > >> And I am not proposing a change here (except to perhaps "git diff >> --staged" instead of "--cached"). Just pointing out that it does not >> follow the "--staged operates on both, --staged-only operates on just >> the index" rule. > > So apart from the wider discussion, I think this patch by itself is a > nice step forward towards improving the UI of this part of git. Is > there any further discussion on this one alone?
I do not think anybody is fundamentally opposed to introduce a consistent set of new synonyms. I do not think anybody disagrees that the word "stage" will be involved in that set, either.
I however have a suspicion that people would regret having applied this "diff --staged" patch, after they realize that other commands need two options "--staged-only" and "--staged-too", and would wish this patch were to introduce a synonym "diff --staged-only", not "diff --staged", for uniformity's sake.
I doubt "Is there any further discussion on THIS ONE ALONE?" is a valid question to ask. What are the other command options we are introducing synonyms for? There is no need for two variants of staged for "diff" (you don't have --staged-too option but instead you give a committish argument, e.g. HEAD), so --staged-only can be abbreviated to --staged without risking any ambiguity. But at least a fully-spelled-out --staged-only should also be accepted, shouldn't it?