Skip to content

Instantly share code, notes, and snippets.

@Anks
Created December 22, 2008 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Anks/38959 to your computer and use it in GitHub Desktop.
Save Anks/38959 to your computer and use it in GitHub Desktop.
#!/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