Re: [RFC 2/2] grep: use '/' delimiter for paths
- From
Jeff King <peff@peff.net>
- Date
- Jan 20, 2017, 14:19 UTC
- Message-ID
- <20170120141954.xyocl6oqoykqmpl5@sigill.intra.peff.net>
- In-Reply-To
- <20170120141212.GC17499@stefanha-x1.localdomain>
On Fri, Jan 20, 2017 at 02:12:12PM +0000, Stefan Hajnoczi wrote:
Show 16 quoted lines
> I find <rev>:<path> vs <rev> -- <path> confusing: > > | <rev>:<path> | <rev> -- <path> > ----------+----------------------+--------------------- > git grep | OK | OK > ----------+----------------------+--------------------- > git show | OK | <path> ignored > ----------+----------------------+--------------------- > git log | no output | OK > ----------+----------------------+--------------------- > > Neither syntax always does what I expect. If git show <rev> -- <path> > honored <path> then I could use that syntax consistently. > > Sorry for going on a tangent. Does it seem reasonable to handle <path> > in git-show(1) as a UI convenience?
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.
-Peff