git - Print percentage of dissimilarity -
sometimes when drastically change file, triggers rewrite:
yes | head -256 > pa.txt git add . git commit -m qu truncate -s128 pa.txt yes n | head -64 >> pa.txt git commit -am ro result:
[master 79b5658] ro 1 file changed, 128 insertions(+), 256 deletions(-) rewrite pa.txt (75%) however not happen smaller changes:
yes | head -128 > pa.txt git add . git commit -m qu truncate -s64 pa.txt yes n | head -32 >> pa.txt git commit -am ro result:
[master 88ef937] ro 1 file changed, 32 insertions(+), 96 deletions(-) can run command show percent change regardless of amount? looked git diff-tree, again seems show when change drastic.
git diff -u10000 | awk ' /^i/ {getline; next} /^-/ {pa += length} /^ / {qu += length} end {printf "%.0f%\n", pa/(pa+qu)*100} ' force full context
-u10000filter out
---linesfilter in deletions , context lines
count bytes each
Comments
Post a Comment