Git diff has the terrific --color-moved option. So I see that Git can detect when lines are moved, but not actually removed.
I need to detect lines removed but not removed. Simply grepping the output of git diff for lines that start with - will not help because that will capture moved lines as well. Can we either:
git diff to show only the removed lines, but not the moved lines?git diff --color-moved to use a different leading character for moved lines, so that we could grep for a leading - on the output to find the removed lines?git diff --color-moved for the (default) red lines, as those are the removed lines?A bit fragile but:
git diff --color-moved=plain --color=always |
perl -pe 's/^\e\[31m-/!/; s/\e\[[0-9;]*m//g'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With