Re: nightly tarballs of git
- From
Junio C Hamano <junkio@cox.net>
- Date
- Sep 14, 2006, 20:06 UTC
- Message-ID
- <7virjq2oyc.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20060914193616.GA32735@redhat.com>
Dave Jones <davej@redhat.com> writes:
Show 13 quoted lines
> DATE=`date +%Y-%m-%d` > > PROJ="git" > cd ~/git-trees > if [ -d $PROJ ]; then > cd $PROJ > git pull -n > else > git clone -q git://git.kernel.org/pub/scm/git/git.git > cd $PROJ > fi > snap=git-snapshot-$(date +"%Y%m%d") > git-tar-tree HEAD $snap | gzip -9 > $PROJ-$DATE.tar.gz
If you are using git-tar-tree (which by the way _is_ the right thing to do) and if you are just taking an upstream snapshot without doing your own development (which also is the case here), then you do not even need a working tree in the directory this script runs. It would save your disk space and time to check out the updated working tree files.
Perhaps...
#!/bin/sh URL=git://git.kernel.org/pub/scm/git/git.git PROJ=git
cd ~/git-trees
if test -d "$PROJ"
then
cd "$PROJ" && git fetch
else
git clone -q -n "$URL" "$PROJ" && cd "$PROJ"
fi || {
echo >&2 Something wicked happend.
exit $?
}
snap=git-snapshot-$(date +"%Y%m%d")
git-tar-tree origin $snap | gzip -9 > $PROJ-$DATE.tar.gz