Last active
August 29, 2015 14:16
-
-
Save avar/497c8c8fbd641fb756ef to your computer and use it in GitHub Desktop.
Ad-hoc benchmark script for git fetch --prune v.s. git remote prune
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 -xe | |
# Clone git.git | |
cd /tmp/ | |
rm -rf git | |
if ! test -d git | |
then | |
git clone --reference ~/g/git https://code.google.com/p/git-core/ git | |
fi | |
# Create a bunch of branches in it | |
cd git | |
for i in {1..1000} | |
do | |
git branch test-$i origin/master || : | |
done | |
# Clone that repo again locally | |
cd /tmp | |
rm -rf git-fetch git-remote-prune | |
git clone --no-hardlinks file:///tmp/git git-fetch | |
cp -Rv git-fetch git-remote-prune | |
# Delete the branches in the original clone | |
cd /tmp/git | |
git branch -l|grep test-|sed 's/^ /git branch -d /'|sh -x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment