Skip to content

Show binary files changes in delta output #93

@gibfahn

Description

@gibfahn

When I use GIT_PAGER=less git show I see the following section for each binary file:

diff --git a/foo b/foo
new file mode 100644
index 0000000..4088911
Binary files /dev/null and b/foo differ

When I use delta with GIT_PAGER="delta --theme=TwoDark" git show, I don't see any output for foo, which is a binary file.

It would be great to see something that shows that there was a binary file and that it has changed, what less shows would be fine.

Quick repro:

mkdir -p tst && cd tst
git init
echo -n -e \\x48\\x00\\x49\\x00 > foo
git add foo
GIT_PAGER="delta --theme=TwoDark" git diff --staged
GIT_PAGER=less git diff --staged

Output:

$ mkdir -p tst && cd tst
$ git init
Initialized empty Git repository in ~/tmp/tst/.git/
$ echo -n -e \\x48\\x00\\x49\\x00 > foo
$ git add foo
$ GIT_PAGER="delta --theme=TwoDark" git diff --staged
$ GIT_PAGER=less git diff --staged
  diff --git a/foo b/foo
  new file mode 100644
  index 0000000..7a42ff1
  Binary files /dev/null and b/foo differ

Thanks for making such a great diff viewer by the way, best one I've found hands down.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions