Re: [RFC 2/2] grep: use '/' delimiter for paths
- From
- Stefan Hajnoczi <stefanha@redhat.com>
- Date
- Jan 23, 2017, 13:29 UTC
- Message-ID
- <20170123132918.GM29186@stefanha-x1.localdomain>
- In-Reply-To
- <xmqq60l9wdb9.fsf@gitster.mtv.corp.google.com>
On Fri, Jan 20, 2017 at 02:56:26PM -0800, Junio C Hamano wrote:
Show 32 quoted lines
> Jeff King <peff@peff.net> writes: > > > It's not ignored; just as with git-log, it's a pathspec to limit the > > diff. E.g.: > > > > $ git show --name-status v2.9.3 > > ... > > M Documentation/RelNotes/2.9.3.txt > > M Documentation/git.txt > > M GIT-VERSION-GEN > > > > $ git show --name-status v2.9.3 -- Documentation > > M Documentation/RelNotes/2.9.3.txt > > M Documentation/git.txt > > > > That's typically less useful than it is with log (where limiting the > > diff also kicks in history simplification and omits some commits > > entirely). But it does do something. > > I think Stefan is missing the fact that the argument to "git show > <tree-ish>:<path>" actually is naming a blob that sits at the <path> > in the <tree-ish>. In other words, "show" is acting as a glorified > "git -p cat-file blob", in that use. > > The use of "git show" you are demonstrating is still about showing > the commit object, whose behaviour is defined to show the log > message and the diff relative to its sole parent, limited to the > paths that match the pathspec. > > It is perfectly fine and desirable that "git show <commit>:<path>" > and "git show <commit> -- <path>" behaves differently. These are > two completely different features.
Thanks for explaining guys. It all makes logical sense. I just hope I remember the distinctions in that table for everyday git use.
Stefan