[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Determining which files are treated as binary

From: Christopher Ness <chris_at_nesser.org>
Date: 2005-06-02 16:55:44 CEST

On Thu, 2005-06-02 at 10:16 -0400, Dominic Anello wrote:
> IIRC, everything without a text/* mime-type will get treated as binary
> so just look for non-text mime-types:
> find . -! -path '*/.svn/*' -type f | \
> | xargs svn propget "svn:mime-type" 2>/dev/null | grep -v 'text/'

Good call on the negation of he mime type. The only thing that scares
me is if you have a directory called "text" in the repository you might
miss a few files since those entries will be filtered out by the last

I also like the fancy find arguments, but I'm too lazy to look them up
in the man page every time so I just chained together some grep's. ;)

I think this will work:

find . -! -path '*/.svn/*' -type f | \
  xargs svn propget "svn:mime-type" 2>/dev/null | \
  grep -v "- text/"

The last grep uses the fact that svn propget prints the output in the
format of "PATH - MIMETYPE\n", ie:
    pear/tests/test-pkg6/pkg6-2.0b1.tgz - application/octet-stream


Wireless Group,
McMaster University
10:48:19 up 23:55, 1 user, load average: 0.03, 0.07, 0.08
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Jun 2 17:19:24 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.