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