Created
November 12, 2014 17:06
-
-
Save nhoriguchi/8e4e5757c94999641101 to your computer and use it in GitHub Desktop.
git-bundle test for stgit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TMPF=$(mktemp -d) | |
SDIR=$TMPF/src | |
DDIR=$TMPF/dst | |
mkdir $SDIR $DDIR | |
commit_num() { | |
local num=$1 | |
echo "data $num" > file | |
git add file | |
git commit -m "commit $num" | |
} | |
commit_num_stgit() { | |
local num=$1 | |
echo "data $num" > file | |
stg new -m "commit $num" | |
stg refresh | |
} | |
pushd $SDIR | |
git init | |
commit_num 1 | |
commit_num 2 | |
commit_num 3 | |
git tag -f start master | |
stg init | |
rsync -a $SDIR/ $DDIR | |
commit_num_stgit 4 | |
commit_num_stgit 5 | |
commit_num_stgit 6 | |
stg pop | |
git bundle create $TMPF/bundle start..master start..master.stgit | |
file $TMPF/bundle | |
popd | |
pushd $DDIR | |
git bundle verify $TMPF/bundle | |
if [ $? -ne 0 ] ; then | |
echo "failed to verify your bundle" >&2 | |
exit 1 | |
fi | |
git remote add origin $TMPF/bundle | |
git pull origin master | |
git checkout -b master.stgit origin/master.stgit | |
git checkout master | |
rsync -a $SDIR/.git/patches/master/ $DDIR/.git/patches/master | |
stg series | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment