Re: [PATCH] git-diff: Add --staged as a synonym for --cached.
- From
Jeff King <peff@peff.net>
- Date
- Nov 12, 2008, 08:33 UTC
- Message-ID
- <20081112083353.GB3817@coredump.intra.peff.net>
- In-Reply-To
- <32541b130811102004n54a47331v48ba8d299039897f@mail.gmail.com>
On Mon, Nov 10, 2008 at 11:04:42PM -0500, Avery Pennarun wrote:
Show 7 quoted lines
> Speaking just for myself, I would find this all a lot less confusing > if "staged" were a refspec of some sort, not an option at all. > > git diff HEAD..STAGED > git diff STAGED..WORKTREE > git grep pattern STAGED HEAD sillybranch WORKTREE ^ignorebranch -- > path/to/files
I agree that such a thing is reasonably intuitive. I have thought about "magic" refspecs before; my local git has an "EMPTY" refspec which points to the empty tree for diffing. However, that was trivial to implement (since it turns into a sha1), and yours is very hard (since you will have to pass these "pretend" objects around).
So I think it is a neat idea, but I am not volunteering to work on it. :)
-Peff