Created
May 3, 2013 13:06
-
-
Save hdznrrd/5509010 to your computer and use it in GitHub Desktop.
A quick hack to generate a test repository
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/perl | |
system("rm -rf sandbox"); | |
mkdir("sandbox"); | |
chdir("sandbox"); | |
system("git init"); | |
sub addFilesWCommits() | |
{ | |
map { $file = $_; | |
print "addFilesWCommits: $file$/"; | |
system("touch $file"); | |
system("git add $file"); | |
system("git commit -m\"added $file\""); } @_; | |
} | |
sub checkout() | |
{ | |
$_ = shift; | |
system("git checkout $_"); | |
} | |
sub branch() | |
{ | |
$_ = shift; | |
system("git checkout -b $_"); | |
} | |
sub merge() | |
{ | |
$_ = shift; | |
system("git merge --no-ff $_"); | |
} | |
&addFilesWCommits("foo","bar","baz"); | |
&branch("ccc"); | |
&addFilesWCommits("cling","clang","clong"); | |
&checkout("master"); | |
&merge("ccc"); | |
&branch("girls"); | |
&addFilesWCommits("anne"); | |
&checkout("master"); | |
&addFilesWCommits("new"); | |
&checkout("girls"); | |
&addFilesWCommits("beth"); | |
&checkout("master"); | |
&addFilesWCommits("newer"); | |
&branch("guys"); | |
&addFilesWCommits("adam"); | |
&checkout("girls"); | |
&addFilesWCommits("crissy"); | |
&checkout("guys"); | |
&addFilesWCommits("brian"); | |
&checkout("master"); | |
&addFilesWCommits("newest"); | |
&checkout("guys"); | |
&addFilesWCommits("carl"); | |
&checkout("girls"); | |
&addFilesWCommits("diane"); | |
&checkout("master"); | |
&merge("girls"); | |
&addFilesWCommits("newestest"); | |
&merge("guys"); | |
&branch("orphan"); | |
&addFilesWCommits("ding","dong"); | |
&checkout("master"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment