infra: Improve the diff output.

Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
This commit is contained in:
Tim 'mithro' Ansell 2019-02-08 10:40:57 +11:00
parent 7c7f446959
commit 98cf09b9df
1 changed files with 25 additions and 2 deletions

View File

@ -80,30 +80,53 @@ echo " Database Differences"
echo "----------------------------------------"
(
cd database
# Update the index with any new files
git add \
--verbose \
--all \
--ignore-errors \
.
# Output what git status
echo
echo "----------------------------------------"
echo " Database Status"
echo "----------------------------------------"
git status
git add *
echo "----------------------------------------"
# Output a summary of how the files have changed
echo
echo "----------------------------------------"
echo " Database Diff Summary"
echo "----------------------------------------"
git diff --stat --irreversible-delete --find-renames --find-copies --ignore-all-space
# Output the actually diff
echo
echo "----------------------------------------"
echo " Database Diff"
echo "----------------------------------------"
git diff --color --irreversible-delete --find-renames --find-copies --ignore-all-space
# Save the diff to be uploaded as an artifact
echo
echo "----------------------------------------"
echo " Generating pretty diff"
echo " Saving diff output"
echo "----------------------------------------"
# Patch file
git diff \
--color --irreversible-delete --find-renames --find-copies --ignore-all-space \
> diff.patch
# Pretty HTML file version
diff2html --summary=open --file diff.html --format html \
-- \
--irreversible-delete --find-renames --find-copies --ignore-all-space \
|| true
# Programmatic JSON version
diff2html --file diff.json --format json \
-- \
--irreversible-delete --find-renames --find-copies --ignore-all-space \