Re: Fwd: Git and Large Binaries: A Proposed Solution
- From
- Pete Wyckoff <pw@padd.com>
- Date
- Jan 23, 2011, 14:14 UTC
- Message-ID
- <20110123141417.GA6133@mew.padd.com>
- In-Reply-To
- <20110121222440.GA1837@sigill.intra.peff.net>
peff@peff.net wrote on Fri, 21 Jan 2011 17:24 -0500:
Show 8 quoted lines
> cat >$HOME/local/bin/huge-clean <<'EOF' > #!/bin/sh > > # In an ideal world, we could actually > # access the original file directly instead of > # having to cat it to a new file. > temp="$(git rev-parse --git-dir)"/huge.$$ > cat >"$temp"
Just a quick aside. Since (a2b665d, 2011-01-05) you can provide the filename as an argument to the filter script:
git config --global filter.huge.clean huge-clean %f
then use it in place:
$ cat >huge-clean
#!/bin/sh
f="$1"
echo orig file is "$f" >&2
sha1=`sha1sum "$f" | cut -d' ' -f1`
cp "$f" /tmp/big_storage/$sha1
rm -f "$f"
echo $sha1-- Pete