0eccf3
#!/bin/sh
0eccf3
0eccf3
# Usage: ./make-git-snapshot.sh [COMMIT]
0eccf3
#
0eccf3
# to make a snapshot of the given tag/branch.  Defaults to HEAD.
0eccf3
# Point env var REF to a local mesa repo to reduce clone time.
0eccf3
0eccf3
DIRNAME=mesa-demos-$( date +%Y%m%d )
0eccf3
0eccf3
echo REF ${REF:+--reference $REF}
0eccf3
echo DIRNAME $DIRNAME
0eccf3
echo HEAD ${1:-HEAD}
0eccf3
0eccf3
rm -rf $DIRNAME
0eccf3
0eccf3
git clone ${REF:+--reference $REF} \
0eccf3
	git://git.freedesktop.org/git/mesa/demos $DIRNAME
0eccf3
0eccf3
GIT_DIR=$DIRNAME/.git git archive --format=tar --prefix=$DIRNAME/ ${1:-HEAD} \
0eccf3
	| bzip2 > $DIRNAME.tar.bz2
0eccf3
0eccf3
# rm -rf $DIRNAME