Created
May 30, 2014 06:02
-
-
Save sbryant/65f097108bff60a27db7 to your computer and use it in GitHub Desktop.
repo generation scripts
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
#!/usr/bin/env bash | |
generate_commit() { | |
number=$RANDOM | |
read -n$number -s -r < /dev/urandom | |
echo $REPLY > $1 | |
git add $1 > /dev/null | |
git commit $1 -m "Adding $1 to $2" > /dev/null | |
} | |
num_commits=$1 | |
num=$2 | |
repo="$num-$(openssl rand -hex 20)" | |
mkdir $repo > /dev/null | |
cd $repo | |
git init > /dev/null | |
for idx in $(seq 1 $num_commits); do | |
generate_commit $idx $repo | |
done | |
cd - |
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
#!/usr/bin/env bash | |
num_repos=$1 | |
num_repos=${num_repos:-100} | |
num_commits=$2 | |
num_commits=${num_commits:-100} | |
concurrency=$3 | |
concurrency=${concurrency:-4} | |
seq 1 $num_repos | | |
xargs -n1 -P$concurrency -t ./generate_repo.sh $num_commits |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment