Skip to content

Instantly share code, notes, and snippets.

@indrekj
Created November 11, 2012 14:03
Show Gist options
  • Select an option

  • Save indrekj/4054976 to your computer and use it in GitHub Desktop.

Select an option

Save indrekj/4054976 to your computer and use it in GitHub Desktop.
Counts how many times have files changed
#!/bin/bash
START=bff040e58fa3f00a5c8caada4d1c00718d2810f2
function filesChanged() {
prev=$START
revs=`git rev-list $START..HEAD --no-merges`
for rev in $revs; do
changed=`git diff --name-only $prev $rev --diff-filter=M`
for file in $changed; do
echo $file
done
prev=$rev
done
}
filesChanged | sort | uniq -c | sort -k1 -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment