git diff: add option for omitting the contents of deletes

From: Mart Sõmermaa <hidden>
Date: 2016-06-15 22:50:40
Subsystem: the rest · Maintainer: Linus Torvalds

Paging through deletes adds a cognitive burden when reviewing code.
Thus we have

    git config --global alias.deleteless-diff 'diff -M --diff-filter=ACMRTUXB'

and using `git deleteless-diff` is standard practice during code reviews.

However, the filter leaves out delete information altogether, which is
error-prone.

Therefore I'd like to propose adding the -D (or
--omit-delete-contents) option to git diff
that would behave as follows:

$ git rm foo
$ git diff -D
diff --git a/foo b/foo
delete foo

I.e. instead of displaying the contents of the file as a diff minus, a
descriptive message
is displayed -- like with renames.

Thoughts, suggestions?
Can 'diff -M --diff-filter=ACMRTUXB' be improved?

Best regards,
Mart Sõmermaa
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help