Re: [RFC 2/2] grep: use '/' delimiter for paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 20, 2017 at 02:12:12PM +0000, Stefan Hajnoczi wrote:

> 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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]