I want to diff -u
python code files, where the target version got some tidy-up, mostly little white space change due to PEP8, yet mixed with little substantial changes (including indentation; and even white space in strings).
How do I best get a diff for reviewing only the substantial changes, or for creating a ham-only patch?
Test example diff SOURCE:
def f(a, b = 0):
c = a*2
c+=b%37
if a//7 + ( b&0x3 ) ==7 :
c+= 8
print "indentlevel"
return a^b+c
and diff TARGET:
def f(a, b=0):
c = a * 2
c += b % 37
if a // 7 + (b & 0x3) == 7:
if a - b > 5:
c += 8
print "indent level"
return a ^ b + c
GNU diff's --ignore-tab-expansion, --ignore-trailing-space, --ignore-space-change, --ignore-all-space, --ignore-blank-lines
do not work satisfactory for that.
Note: the requirement of mixed changes is given. (2-step editing is not even practical in future in many cases)