GitDeepDive/largeFile-setup.sh

85 lines
2.2 KiB
Bash
Raw Normal View History

2018-06-26 08:03:58 +00:00
#!/bin/bash
# Run the merge set-up script to create a clean DeepDive1 dir.
SCRIPT_DIR=$(cd $(dirname ${0}); pwd)
declaim () {
echo
echo ${*}
echo "==============="
echo
}
REPO_DIR=${SCRIPT_DIR}/largeFileRepo
${SCRIPT_DIR}/merge-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
declaim "Merging Rel1 and Rel2 into master"
git checkout master
git merge Rel1
git merge -m "commit8" Rel2
declaim "Repository size in kibibytes: $(du -sk .)"
declaim "Creating a 10MiB binary file"
gzip -9 -c information.md > information_compressed.out
counter=0
while [ ${counter} -lt 15 ];
do
cat information_compressed.out information_compressed.out > information_compressed2.out
mv information_compressed2.out information_compressed.out
counter=$(( $counter + 1 ))
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"
declaim "Creating and checking out the Rel3 branch"
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"
declaim "Creating and checking out the Rel4 branch"
git checkout master
git checkout -b Rel4
declaim "Modifying the large binary file on Rel4"
cat largeInformation.md largeInformation.md > largeInformation2.md
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"
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
declaim "Removing that large file, now."
git rm largeInformation.md
git commit -m "large binary file gone again"
git log --oneline --graph --decorate --all
declaim "Repository size in kibibytes: $(du -sk .)"