Skip to content

Instantly share code, notes, and snippets.

@jacobat
Created July 24, 2009 08:01
Show Gist options
  • Select an option

  • Save jacobat/153911 to your computer and use it in GitHub Desktop.

Select an option

Save jacobat/153911 to your computer and use it in GitHub Desktop.
#!/bin/sh
OLD_HEAD=$1
NEW_HEAD=$2
HASH=`git show-ref --heads --hash=8 $NEW_HEAD`
TARBASENAME=`basename $PWD`
TARFILENAME=pkgs/$TARBASENAME.$HASH.tar.bz2
echo "Packaging files:"
echo ""
tar jcvf $TARFILENAME `git diff --name-only --stat $OLD_HEAD..$NEW_HEAD`
echo ""
echo "Created new package $TARFILENAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment