git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git grep prints colon instead of slash
@ 2018-11-21 13:54 Marc Gonzalez
  2018-11-21 13:59 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Gonzalez @ 2018-11-21 13:54 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

Hello,

I'm using an older version of git, so this particular issue might have
already been fixed.

$ git --version
git version 2.17.1


If I specify the branch to explore, git grep prints a colon instead of
a slash in the path:

$ git grep arm,coresight-tmc master:Documentation/devicetree
master:Documentation/devicetree:bindings/arm/coresight.txt:                     "arm,coresight-tmc", "arm,primecell";
master:Documentation/devicetree:bindings/arm/coresight.txt:             compatible = "arm,coresight-tmc", "arm,primecell";
                               ^
                              HERE

There is no such issue when the branch is not specified:

$ git grep arm,coresight-tmc Documentation/devicetree
Documentation/devicetree/bindings/arm/coresight.txt:                    "arm,coresight-tmc", "arm,primecell";
Documentation/devicetree/bindings/arm/coresight.txt:            compatible = "arm,coresight-tmc", "arm,primecell";
                        ^
                    NO ISSUE


Is this expected behavior?
The spurious colon prevents one from simply copy/pasting the output.

Regards.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: git grep prints colon instead of slash
  2018-11-21 13:54 git grep prints colon instead of slash Marc Gonzalez
@ 2018-11-21 13:59 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2018-11-21 13:59 UTC (permalink / raw)
  To: Marc Gonzalez; +Cc: git, Junio C Hamano

On Wed, Nov 21, 2018 at 02:54:34PM +0100, Marc Gonzalez wrote:

> If I specify the branch to explore, git grep prints a colon instead of
> a slash in the path:
> 
> $ git grep arm,coresight-tmc master:Documentation/devicetree
> master:Documentation/devicetree:bindings/arm/coresight.txt:                     "arm,coresight-tmc", "arm,primecell";
> master:Documentation/devicetree:bindings/arm/coresight.txt:             compatible = "arm,coresight-tmc", "arm,primecell";
>                                ^
>                               HERE
> 
> There is no such issue when the branch is not specified:
> 
> $ git grep arm,coresight-tmc Documentation/devicetree
> Documentation/devicetree/bindings/arm/coresight.txt:                    "arm,coresight-tmc", "arm,primecell";
> Documentation/devicetree/bindings/arm/coresight.txt:            compatible = "arm,coresight-tmc", "arm,primecell";
>                         ^
>                     NO ISSUE
> 
> 
> Is this expected behavior?
> The spurious colon prevents one from simply copy/pasting the output.

There's lots of discussion in this thread from last year:

  https://public-inbox.org/git/20170119150347.3484-1-stefanha@redhat.com/

Notably:

  git grep arm,coresight-tmc master -- Documentation/devicetree

will do what you want.

-Peff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-21 13:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-21 13:54 git grep prints colon instead of slash Marc Gonzalez
2018-11-21 13:59 ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).