Created
March 17, 2025 12:52
-
-
Save nathanpc/dbe6e50b40708d01432e48e65a5001f3 to your computer and use it in GitHub Desktop.
Creates a LaTeX difference project from a repository and 2 separate commits
This file contains hidden or 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
#!/bin/bash | |
# Settings | |
repourl="[email protected]:nathanpc/paper-iot-framework.git" | |
sha1_old="da7d715db0df634a8fa7d403661df0c649d5bd42" | |
sha1_new="97e926cdbc28a3765754eb96d65be0b39f572e7c" | |
# Clone and duplicate repositories. | |
echo "Cloning repository..." | |
git clone "$repourl" old | |
cp -r old new | |
echo "Resetting old repository..." | |
pushd old | |
git reset --hard $sha1_old | |
popd | |
echo "Resetting new repository..." | |
pushd new | |
git reset --hard $sha1_new | |
popd | |
# Make diff | |
echo "Building difference document..." | |
cp -r new diff | |
find diff -type f -iname '*.tex' | sed 's/^diff\///g' | perl -ne 'chomp; system("latexdiff \"old/$_\" \"new/$_\" > \"diff/$_\"");' | |
echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment