git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Herland <johan@herland.net>
To: git@vger.kernel.org
Subject: How to supply "raw" bytes to git grep?
Date: Thu, 18 Sep 2008 17:28:18 +0200	[thread overview]
Message-ID: <200809181728.18597.johan@herland.net> (raw)

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

             reply	other threads:[~2008-09-18 15:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-18 15:28 Johan Herland [this message]
2008-09-18 15:46 ` How to supply "raw" bytes to git grep? Jacob Helwig
2008-09-18 16:18   ` Johan Herland
2008-09-18 22:07   ` Kalle Olavi Niemitalo
2008-09-18 16:31 ` Jakub Narebski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200809181728.18597.johan@herland.net \
    --to=johan@herland.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).