All of lore.kernel.org
 help / color / mirror / Atom feed
* How to supply "raw" bytes to git grep?
@ 2008-09-18 15:28 Johan Herland
  2008-09-18 15:46 ` Jacob Helwig
  2008-09-18 16:31 ` Jakub Narebski
  0 siblings, 2 replies; 5+ messages in thread
From: Johan Herland @ 2008-09-18 15:28 UTC (permalink / raw)
  To: git

Hi,

I wanted to list all text files in my repo which contain carriage 
returns, so I tried the following command-line:

	git grep --cached -I -l -e <CR>

where <CR> is some magic incantation that I've yet to figure out. I've 
tried all the obvious cases (\r, 0x0d, \015, etc.), but none of them 
seem to DWIM...

The only working solution I've found so far is to create a file 
(named "cr") in a hex editor that contains exactly one CR byte, and 
then use the -f option to 'git grep':

	git grep --cached -I -l -f cr

Is there an easier way? And if not, should I try to create one (e.g. 
teaching 'git grep' to grok backslash escapes)?


Have fun!

...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

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

end of thread, other threads:[~2008-09-18 22:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-18 15:28 How to supply "raw" bytes to git grep? Johan Herland
2008-09-18 15:46 ` Jacob Helwig
2008-09-18 16:18   ` Johan Herland
2008-09-18 22:07   ` Kalle Olavi Niemitalo
2008-09-18 16:31 ` Jakub Narebski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.