Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show binary files changes in delta output #93

Closed
gibfahn opened this issue Feb 12, 2020 · 3 comments · Fixed by #94
Closed

Show binary files changes in delta output #93

gibfahn opened this issue Feb 12, 2020 · 3 comments · Fixed by #94

Comments

@gibfahn
Copy link

gibfahn commented Feb 12, 2020

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.

@dandavison
Copy link
Owner

Thanks for reporting this and thanks for the reproduction script. I've fixed this in #94, and added a test. However, as noted in that PR, I am currently confused about why the test is passing before the fix commit. If you do have a local rust setup and feel like building on that branch to confirm the fix that would be great, but no worries if not and thanks for the report!

dandavison added a commit that referenced this issue Feb 12, 2020
@Kr1ss-XD
Copy link
Contributor

FWIW, I just checked out #94 and rebuilt; on my end this issue is fixed.

Looks good to me, thx ! 👍

@gibfahn
Copy link
Author

gibfahn commented Feb 12, 2020

Checked and it works, thanks for fixing it so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants