Skip to content

Instantly share code, notes, and snippets.

@kojiromike
Created June 15, 2012 20:14
Show Gist options
  • Save kojiromike/2938493 to your computer and use it in GitHub Desktop.
Save kojiromike/2938493 to your computer and use it in GitHub Desktop.
list only changed files for each commit
logchanged() {
local thiscommit
local prevcommit
(( numcommits < 0 )) || unset numcommits
while read prevcommit; do
if [[ $thiscommit && $prevcommit ]]; then
printf -- '========================================\n'
printf -- '%s\n' "$thiscommit"
printf -- '----------------------------------------\n'
git diff --name-only "$thiscommit" "$prevcommit"
echo
fi
thiscommit="$prevcommit"
done < <(git log --pretty=format:%H)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment