New commit in Git/spar/
[sunny256-utils.git] / nogit
blob85a31d3165723132a51b26724e40f8ca7fcb2fea
1 #!/bin/sh
3 #=======================================================================
4 # File ID: 0195ded2-918c-11de-873c-00248cd5cf1e
5 # Reads a bunch of filenames from stdin or files specified on the
6 # command line and strips .git directories away. Examples:
8 # Show the size of the working copy without the .git directories:
9 # cd /working/copy
10 # find . -type f | nogit | xargs wc -c
12 # Specifying -r (for reverse) as the first parameter lists only .git
13 # directories and their contents.
14 #=======================================================================
16 if [ "$1" = "-r" ]; then
17 shift
18 cat $* | egrep '/\.git(/|$)'
19 else
20 cat $* | egrep -v '/\.git(/|$)'