delta icon indicating copy to clipboard operation
delta copied to clipboard

🐛 Adding an empty file doesn't show up in `git show`

Open gibfahn opened this issue 5 years ago • 2 comments

If a commit adds an empty file, delta doesn't show it in the output, but git does.

I'm assuming this is a bug, but in case it's a feature, it's very helpful to show these empty files, as they often have marker or other useful purposes.

Minimal reproduction:

touch foo
git add foo
git commit -m 'Test'
git --no-pager show
GIT_PAGER=delta git show

Output:

$ GIT_PAGER=delta git show
  commit 9739454fde7dbdcd69035e59c17c33e347e8891f (HEAD -> master)
  Author: Gibson Fahnestock <[email protected]>
  Date:   Fri Sep 25 10:35:36 2020 +0100

      Test


$ git --no-pager show
commit 9739454fde7dbdcd69035e59c17c33e347e8891f (HEAD -> master)
Author: Gibson Fahnestock <[email protected]>
Date:   Fri Sep 25 10:35:36 2020 +0100

    Test

diff --git a/foo b/foo
new file mode 100644
index 0000000..e69de29

gibfahn avatar Sep 25 '20 09:09 gibfahn