From b961847325ece0f5beea94cf2378a6e5026027ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ibhear=20=C3=93=20hAnluain?= Date: Mon, 23 Sep 2019 13:33:45 +0100 Subject: [PATCH] largeFile-setup.sh to use the utility functions. Also, removing that silly double-load check: doesn't work. --- largeFile-setup.sh | 51 +++++++++++++++++++++------------------------- utils.sh | 7 ------- 2 files changed, 23 insertions(+), 35 deletions(-) diff --git a/largeFile-setup.sh b/largeFile-setup.sh index 281e277..c9ca2f2 100755 --- a/largeFile-setup.sh +++ b/largeFile-setup.sh @@ -4,12 +4,7 @@ SCRIPT_DIR=$(cd $(dirname ${0}); pwd) -declaim () { - echo - echo ${*} - echo "===============" - echo -} +. ${SCRIPT_DIR}/utils.sh REPO_DIR=${SCRIPT_DIR}/largeFileRepo @@ -18,15 +13,15 @@ ${SCRIPT_DIR}/simple-setup.sh ${REPO_DIR} cd ${REPO_DIR} declaim "Creating tags" -git tag Rel1.0.lw Rel1 -git tag -m "An annotated tag for the Rel1 release" Rel1.0.a Rel1 -git tag Rel2.0.lw Rel2 -git tag -m "An annotated tag for the Rel1 release" Rel2.0.a Rel2 +git_command git tag Rel1.0.lw Rel1 +git_command git tag -m "\"An annotated tag for the Rel1 release\"" Rel1.0.a Rel1 +git_command git tag Rel2.0.lw Rel2 +git_command git tag -m "\"An annotated tag for the Rel1 release\"" Rel2.0.a Rel2 declaim "Merging Rel1 and Rel2 into master" -git checkout master -git merge Rel1 -git merge -m "commit8" Rel2 +git_command git checkout master +git_command git merge Rel1 +git_command git merge -m "\"commit8\"" Rel2 declaim "Repository size in kibibytes: $(du -sk .)" @@ -44,22 +39,22 @@ done mv information_compressed.out largeInformation.md declaim "Adding and commiting that new file" -git add largeInformation.md -git commit -m "A large, awkwardly binary file" +git_command git add largeInformation.md +git_command git commit -m "\"A large, awkwardly binary file\"" declaim "Creating and checking out the Rel3 branch" -git checkout -b Rel3 +git_command git checkout -b Rel3 declaim "Modifying the large binary file on Rel3" cat information.md information.md information.md >> largeInformation.md declaim "Adding and commiting that change to the binary file." -git add largeInformation.md -git commit -m "Changes to that large file" +git_command git add largeInformation.md +git_command git commit -m "\"Changes to that large file\"" declaim "Creating and checking out the Rel4 branch" -git checkout master -git checkout -b Rel4 +git_command git checkout master +git_command git checkout -b Rel4 declaim "Modifying the large binary file on Rel4" cat largeInformation.md largeInformation.md > largeInformation2.md @@ -67,18 +62,18 @@ rm largeInformation.md mv largeInformation{2,}.md declaim "Adding and commiting that change to the binary file." -git add largeInformation.md -git commit -m "An even larger file" +git_command git add largeInformation.md +git_command git commit -m "\"An even larger file\"" declaim "Merging Rel3 and Rel4 into master" -git checkout master -git merge Rel3 -git merge -s recursive -Xtheirs -m "Merge of Rel4 into master" Rel4 +git_command git checkout master +git_command git merge Rel3 +git_command git merge -s recursive -Xtheirs -m "\"Merge of Rel4 into master\"" Rel4 declaim "Removing that large file, now." -git rm largeInformation.md -git commit -m "large binary file gone again" +git_command git rm largeInformation.md +git_command git commit -m "\"large binary file gone again\"" -git log --oneline --graph --decorate --all +git_command git log --oneline --graph --decorate --all declaim "Repository size in kibibytes: $(du -sk .)" diff --git a/utils.sh b/utils.sh index ca047aa..4c3d620 100644 --- a/utils.sh +++ b/utils.sh @@ -1,9 +1,4 @@ -if [ "${UTILS_LOADED}" = "Y" ]; then - echo "Returning" - return -fi - # A function to make a statement. declaim () { echo @@ -40,5 +35,3 @@ git_command() { # Execute the command. eval ${*} } - -export UTILS_LOADED="Y"