* git list binary and/or non-binary files?
@ 2009-08-24 21:50 skillzero
2009-08-24 22:14 ` Johan Herland
0 siblings, 1 reply; 3+ messages in thread
From: skillzero @ 2009-08-24 21:50 UTC (permalink / raw)
To: git
Is there a way to list the files git considers binary in a repository
(and alternatively, the ones it considers text)? I have a large
repository and I want to fix line endings for text files that were
accidentally checked in using CRLF and can't just use the file
extension alone because some files with the same extension may be
binary and others not (e.g. UTF-8 .strings file is text, but a UTF-16
.strings file is binary...git already figured out based on the content
that one is binary).
I thought maybe git ls-files, but I didn't see anything in there I can
use for binary vs text.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: git list binary and/or non-binary files?
2009-08-24 21:50 git list binary and/or non-binary files? skillzero
@ 2009-08-24 22:14 ` Johan Herland
2009-08-24 22:39 ` skillzero
0 siblings, 1 reply; 3+ messages in thread
From: Johan Herland @ 2009-08-24 22:14 UTC (permalink / raw)
To: git; +Cc: skillzero
On Monday 24 August 2009, skillzero@gmail.com wrote:
> Is there a way to list the files git considers binary in a repository
> (and alternatively, the ones it considers text)? I have a large
> repository and I want to fix line endings for text files that were
> accidentally checked in using CRLF and can't just use the file
> extension alone because some files with the same extension may be
> binary and others not (e.g. UTF-8 .strings file is text, but a UTF-16
> .strings file is binary...git already figured out based on the content
> that one is binary).
>
> I thought maybe git ls-files, but I didn't see anything in there I can
> use for binary vs text.
I use the following to list files that contain CRs, but that are not
considered binary by Git:
git grep --cached -I -l -e $'\r'
'git help grep' explains all the options...
Have fun! :)
...Johan
--
Johan Herland, <johan@herland.net>
www.herland.net
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: git list binary and/or non-binary files?
2009-08-24 22:14 ` Johan Herland
@ 2009-08-24 22:39 ` skillzero
0 siblings, 0 replies; 3+ messages in thread
From: skillzero @ 2009-08-24 22:39 UTC (permalink / raw)
To: Johan Herland; +Cc: git
On Mon, Aug 24, 2009 at 3:14 PM, Johan Herland<johan@herland.net> wrote:
> I use the following to list files that contain CRs, but that are not
> considered binary by Git:
>
> git grep --cached -I -l -e $'\r'
Thanks, that's what I needed. I needed it to build a list to pass to a
script so I used 'git grep -I --name-only -z -e "" | xargs -o ...'
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-08-24 22:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-24 21:50 git list binary and/or non-binary files? skillzero
2009-08-24 22:14 ` Johan Herland
2009-08-24 22:39 ` skillzero
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).