From 73e740d1ba45e6c01988953234f8e217b811d1dc Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sat, 11 Aug 2018 15:04:02 +1000 Subject: clean up fixup code reduce log clutter add log dumping with spew --- test/generate_basic_repo.sh | 49 --------------------------------------------- test/lots_of_commits.sh | 28 ++++++++++++++++++++++++++ test/merge_conflict.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 49 deletions(-) delete mode 100755 test/generate_basic_repo.sh create mode 100755 test/lots_of_commits.sh create mode 100755 test/merge_conflict.sh (limited to 'test') diff --git a/test/generate_basic_repo.sh b/test/generate_basic_repo.sh deleted file mode 100755 index ef04333c7..000000000 --- a/test/generate_basic_repo.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -# this script will make a repo with a master and develop branch, where we end up -# on the master branch and if we try and merge master we get a merge conflict - -# call this command from the test directory: -# ./generate_basic_repo.sh; cd testrepo; gg; cd .. - -# -e means exit if something fails -# -x means print out simple commands before running them -set -ex - -reponame="testrepo" - -rm -rf ${reponame} -mkdir ${reponame} -cd ${reponame} - -git init - -function add_spacing { - for i in {1..60} - do - echo "..." >> $1 - done -} - -echo "Here is a story that has been told throuhg the ages" >> file1 - -git add file1 -git commit -m "first commit" - -git checkout -b develop - -echo "once upon a time there was a dog" >> file1 -add_spacing file1 -echo "once upon a time there was another dog" >> file1 -git add file1 -git commit -m "first commit on develop" - -git checkout master - -echo "once upon a time there was a cat" >> file1 -add_spacing file1 -echo "once upon a time there was another cat" >> file1 -git add file1 -git commit -m "first commit on develop" - -git merge develop # should have a merge conflict here diff --git a/test/lots_of_commits.sh b/test/lots_of_commits.sh new file mode 100755 index 000000000..d85034f4e --- /dev/null +++ b/test/lots_of_commits.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# this script makes a repo with lots of commits + +# call this command from the test directory: +# ./lots_of_commits.sh; cd testrepo; gg; cd .. + +# -e means exit if something fails +# -x means print out simple commands before running them +set -ex + +reponame="testrepo" + +rm -rf ${reponame} +mkdir ${reponame} +cd ${reponame} + +git init + +i=2 +end=100 +while [ $i -le $end ]; do + echo "file${i}" > file${i} + git add file${i} + git commit -m file${i} + + i=$(($i+1)) +done diff --git a/test/merge_conflict.sh b/test/merge_conflict.sh new file mode 100755 index 000000000..9bd12bf56 --- /dev/null +++ b/test/merge_conflict.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# this script will make a repo with a master and develop branch, where we end up +# on the master branch and if we try and merge master we get a merge conflict + +# call this command from the test directory: +# ./merge_conflict.sh; cd testrepo; gg; cd .. + +# -e means exit if something fails +# -x means print out simple commands before running them +set -ex + +reponame="testrepo" + +rm -rf ${reponame} +mkdir ${reponame} +cd ${reponame} + +git init + +function add_spacing { + for i in {1..60} + do + echo "..." >> $1 + done +} + +echo "Here is a story that has been told throuhg the ages" >> file1 + +git add file1 +git commit -m "first commit" + +git checkout -b develop + +echo "once upon a time there was a dog" >> file1 +add_spacing file1 +echo "once upon a time there was another dog" >> file1 +git add file1 +git commit -m "first commit on develop" + +git checkout master + +echo "once upon a time there was a cat" >> file1 +add_spacing file1 +echo "once upon a time there was another cat" >> file1 +git add file1 +git commit -m "first commit on develop" + +git merge develop # should have a merge conflict here -- cgit v1.2.3