largeFile-setup.sh to use the utility functions.

Also, removing that silly double-load check: doesn't work.
This commit is contained in:
Éibhear Ó hAnluain 2019-09-23 13:33:45 +01:00
parent 4c5e6c09ed
commit b961847325
2 changed files with 23 additions and 35 deletions

View file

@ -4,12 +4,7 @@
SCRIPT_DIR=$(cd $(dirname ${0}); pwd) SCRIPT_DIR=$(cd $(dirname ${0}); pwd)
declaim () { . ${SCRIPT_DIR}/utils.sh
echo
echo ${*}
echo "==============="
echo
}
REPO_DIR=${SCRIPT_DIR}/largeFileRepo REPO_DIR=${SCRIPT_DIR}/largeFileRepo
@ -18,15 +13,15 @@ ${SCRIPT_DIR}/simple-setup.sh ${REPO_DIR}
cd ${REPO_DIR} cd ${REPO_DIR}
declaim "Creating tags" declaim "Creating tags"
git tag Rel1.0.lw Rel1 git_command git tag Rel1.0.lw Rel1
git tag -m "An annotated tag for the Rel1 release" Rel1.0.a Rel1 git_command git tag -m "\"An annotated tag for the Rel1 release\"" Rel1.0.a Rel1
git tag Rel2.0.lw Rel2 git_command git tag Rel2.0.lw Rel2
git tag -m "An annotated tag for the Rel1 release" Rel2.0.a Rel2 git_command git tag -m "\"An annotated tag for the Rel1 release\"" Rel2.0.a Rel2
declaim "Merging Rel1 and Rel2 into master" declaim "Merging Rel1 and Rel2 into master"
git checkout master git_command git checkout master
git merge Rel1 git_command git merge Rel1
git merge -m "commit8" Rel2 git_command git merge -m "\"commit8\"" Rel2
declaim "Repository size in kibibytes: $(du -sk .)" declaim "Repository size in kibibytes: $(du -sk .)"
@ -44,22 +39,22 @@ done
mv information_compressed.out largeInformation.md mv information_compressed.out largeInformation.md
declaim "Adding and commiting that new file" declaim "Adding and commiting that new file"
git add largeInformation.md git_command git add largeInformation.md
git commit -m "A large, awkwardly binary file" git_command git commit -m "\"A large, awkwardly binary file\""
declaim "Creating and checking out the Rel3 branch" 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" declaim "Modifying the large binary file on Rel3"
cat information.md information.md information.md >> largeInformation.md cat information.md information.md information.md >> largeInformation.md
declaim "Adding and commiting that change to the binary file." declaim "Adding and commiting that change to the binary file."
git add largeInformation.md git_command git add largeInformation.md
git commit -m "Changes to that large file" git_command git commit -m "\"Changes to that large file\""
declaim "Creating and checking out the Rel4 branch" declaim "Creating and checking out the Rel4 branch"
git checkout master git_command git checkout master
git checkout -b Rel4 git_command git checkout -b Rel4
declaim "Modifying the large binary file on Rel4" declaim "Modifying the large binary file on Rel4"
cat largeInformation.md largeInformation.md > largeInformation2.md cat largeInformation.md largeInformation.md > largeInformation2.md
@ -67,18 +62,18 @@ rm largeInformation.md
mv largeInformation{2,}.md mv largeInformation{2,}.md
declaim "Adding and commiting that change to the binary file." declaim "Adding and commiting that change to the binary file."
git add largeInformation.md git_command git add largeInformation.md
git commit -m "An even larger file" git_command git commit -m "\"An even larger file\""
declaim "Merging Rel3 and Rel4 into master" declaim "Merging Rel3 and Rel4 into master"
git checkout master git_command git checkout master
git merge Rel3 git_command git merge Rel3
git merge -s recursive -Xtheirs -m "Merge of Rel4 into master" Rel4 git_command git merge -s recursive -Xtheirs -m "\"Merge of Rel4 into master\"" Rel4
declaim "Removing that large file, now." declaim "Removing that large file, now."
git rm largeInformation.md git_command git rm largeInformation.md
git commit -m "large binary file gone again" 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 .)" declaim "Repository size in kibibytes: $(du -sk .)"

View file

@ -1,9 +1,4 @@
if [ "${UTILS_LOADED}" = "Y" ]; then
echo "Returning"
return
fi
# A function to make a statement. # A function to make a statement.
declaim () { declaim () {
echo echo
@ -40,5 +35,3 @@ git_command() {
# Execute the command. # Execute the command.
eval ${*} eval ${*}
} }
export UTILS_LOADED="Y"