{"thread":{"id":"15575","subject":"How to supply \"raw\" bytes to git grep?","startedAt":"2008-09-18T15:28:18Z","lastAt":"2008-09-18T22:07:56Z","messageCount":5,"participants":["Johan Herland","Jacob Helwig","Jakub Narebski","Kalle Olavi Niemitalo"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"91033","messageId":"200809181728.18597.johan@herland.net","threadId":"15575","inReplyTo":null,"subject":"How to supply \"raw\" bytes to git grep?","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2008-09-18T15:28:18Z","receivedAt":"2008-09-18T15:28:18Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"Hi,\n\nI wanted to list all text files in my repo which contain carriage \nreturns, so I tried the following command-line:\n\n\tgit grep --cached -I -l -e <CR>\n\nwhere <CR> is some magic incantation that I've yet to figure out. I've \ntried all the obvious cases (\\r, 0x0d, \\015, etc.), but none of them \nseem to DWIM...\n\nThe only working solution I've found so far is to create a file \n(named \"cr\") in a hex editor that contains exactly one CR byte, and \nthen use the -f option to 'git grep':\n\n\tgit grep --cached -I -l -f cr\n\nIs there an easier way? And if not, should I try to create one (e.g. \nteaching 'git grep' to grok backslash escapes)?\n\n\nHave fun!\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"91034","messageId":"8c9a060809180846j25e4eb44h291b017aa01bbe36@mail.gmail.com","threadId":"15575","inReplyTo":"200809181728.18597.johan@herland.net","subject":"Re: How to supply \"raw\" bytes to git grep?","fromName":"Jacob Helwig","fromEmail":"jacob.helwig@gmail.com","sentAt":"2008-09-18T15:46:49Z","receivedAt":"2008-09-18T15:46:49Z","isPatch":false,"sender":{"key":"jacob.helwig@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14557?v=4"},"body":"On Thu, Sep 18, 2008 at 08:28, Johan Herland <johan@herland.net> wrote:\n> Hi,\n>\n> I wanted to list all text files in my repo which contain carriage\n> returns, so I tried the following command-line:\n>\n>        git grep --cached -I -l -e <CR>\n>\n> where <CR> is some magic incantation that I've yet to figure out. I've\n> tried all the obvious cases (\\r, 0x0d, \\015, etc.), but none of them\n> seem to DWIM...\n>\n> The only working solution I've found so far is to create a file\n> (named \"cr\") in a hex editor that contains exactly one CR byte, and\n> then use the -f option to 'git grep':\n>\n>        git grep --cached -I -l -f cr\n>\n> Is there an easier way? And if not, should I try to create one (e.g.\n> teaching 'git grep' to grok backslash escapes)?\n>\n>\n> Have fun!\n>\n> ...Johan\n>\n> --\n> Johan Herland, <johan@herland.net>\n> www.herland.net\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n\nInserting a literal carriage return seems to do the trick for me, in bash.\n\ngit grep --cached -I -l -e <Ctrl-V><Ctrl-M>\n"},{"id":"91040","messageId":"200809181818.42745.johan@herland.net","threadId":"15575","inReplyTo":"8c9a060809180846j25e4eb44h291b017aa01bbe36@mail.gmail.com","subject":"Re: How to supply \"raw\" bytes to git grep?","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2008-09-18T16:18:42Z","receivedAt":"2008-09-18T16:18:42Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Thursday 18 September 2008, Jacob Helwig wrote:\n> On Thu, Sep 18, 2008 at 08:28, Johan Herland wrote:\n> > I wanted to list all text files in my repo which contain carriage\n> > returns, so I tried the following command-line:\n> >\n> >        git grep --cached -I -l -e <CR>\n> >\n> > where <CR> is some magic incantation that I've yet to figure out.\n> > I've tried all the obvious cases (\\r, 0x0d, \\015, etc.), but none\n> > of them seem to DWIM...\n>\n> Inserting a literal carriage return seems to do the trick for me, in\n> bash.\n>\n> git grep --cached -I -l -e <Ctrl-V><Ctrl-M>\n\nThanks. That's exactly the incantation I was looking for. ;)\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"91045","messageId":"gatvp0$kl0$1@ger.gmane.org","threadId":"15575","inReplyTo":"200809181728.18597.johan@herland.net","subject":"Re: How to supply \"raw\" bytes to git grep?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-09-18T16:31:30Z","receivedAt":"2008-09-18T16:31:30Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Johan Herland wrote:\n\n> I wanted to list all text files in my repo which contain carriage \n> returns, so I tried the following command-line:\n> \n>       git grep --cached -I -l -e <CR>\n> \n> where <CR> is some magic incantation that I've yet to figure out. I've \n> tried all the obvious cases (\\r, 0x0d, \\015, etc.), but none of them \n> seem to DWIM...\n\nWhy not use _literal_ CR; of course protecting it by piockung it by\nshell as end of command by quites, for example\n\n  $ git grep --cached -I -l -e '\n  '\n\nIt works for me (bash).\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"91081","messageId":"871vzhglab.fsf@Astalo.kon.iki.fi","threadId":"15575","inReplyTo":"8c9a060809180846j25e4eb44h291b017aa01bbe36@mail.gmail.com","subject":"Re: How to supply \"raw\" bytes to git grep?","fromName":"Kalle Olavi Niemitalo","fromEmail":"kon@iki.fi","sentAt":"2008-09-18T22:07:56Z","receivedAt":"2008-09-18T22:07:56Z","isPatch":false,"sender":{"key":"kon@iki.fi","avatar":null},"body":"\"Jacob Helwig\" <jacob.helwig@gmail.com> writes:\n\n> Inserting a literal carriage return seems to do the trick for me, in bash.\n>\n> git grep --cached -I -l -e <Ctrl-V><Ctrl-M>\n\nIn bash, $'\\r' works too, and may be nicer to edit.\nBetter not use that with #! /bin/sh though.\n"}]}