Created
December 22, 2008 11:39
-
-
Save Anks/38959 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env bash | |
# Gives you file-by-file change stats between two archives. | |
# Assuming your two archives are original.tar.gz and modified.tar.gz in | |
# the curent directory. | |
# I know that there is a tool called diffstat for this very purpose, | |
# and git probably uses it internally as well. I wanted to demo the | |
# git-diff --stat command. | |
mkdir repo | |
cd repo | |
tar -zxvf ../original.tar.gz | |
# Create a git repo with original contents | |
git init | |
git add * | |
git commit -m 'Initial version' | |
# Extract the updated contents and commit | |
tar -zxvf ../modified.tar.gz | |
git add * | |
git commit -m 'Modified version' | |
# Get stats | |
git diff --stat HEAD~1 HEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment