git - Find commits that only change whitespace -


how can find commits in git branch have changes modify whitespace? don't care merge commits.

more generally, best way find git commits based on aspects of diff. know git log -s, works simple cases (when want find text in diff).

something should do

branch=<branch wish check> commit in $(git rev-list --no-merges $branch);     if [ -z "$(git diff -b $commit^..$commit)" ];         echo "$commit modifies whitespace."     fi done 

Comments