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

Gstatus: silently ignores binary files with inline diffs #1377

Open
blueyed opened this issue Oct 17, 2019 · 2 comments
Open

Gstatus: silently ignores binary files with inline diffs #1377

blueyed opened this issue Oct 17, 2019 · 2 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented Oct 17, 2019

Having an unstaged changed file, where Git reports the differences as binary silently does nothing when using = to see the inline diff.

From debugging:

>echo info
{'sigil': '', 'status': 'M', 'heading': 'Unstaged (1)', 'section': 'Unstaged', 'sub': 'N...', 'offset': -1, 'paths': ['…/Vcs/neovim/.vim-src/src/testdir/test42.in'
], 'index': 1, 'relative': ['src/testdir/test42.in'], 'commit': '', 'filename': 'src/testdir/test42.in'}
line 24: endif
line 25: if getline(lnum + 1) =~# '^[ @\+-]'
line 37: endif
line 38: if !has_key(b:fugitive_diff, info.section) || info.status !~# '^[ADMRU]$' || a:mode ==# 'hide'
>echo b:fugitive_diff
{'Unstaged': ['diff --git src/testdir/test42.in src/testdir/test42.in', 'index c35569a76..438a48055 100644', 'Binary files src/testdir/test42.in and src/testdir/test42.in dif
fer'], 'Staged': []}
>
:return ['# branch.oid 1142a31b8c44c4e7dbf28a83ae52995113b37917^A# branch.head master^A# branch.upstream origin/master^A# branch.ab +0 -0^A1 .M N... 100644 100644 100644 c355
69a76c908682eb8e7e7ab8d9a3522d9fa473 c35569a76c908682eb8e7e7ab8d9a3522d9fa473 src/testdir/test42.in^A', 0] made pending
:return ['# branch.oid 1142a31b8c44c4e7dbf28a83ae52995113b37917^A# branch.head master^A# branch.upstream origin/master^A# branch.ab +0 -0^A1 .M N... 100644 100644 100644 c355
69a76c908682eb8e7e7ab8d9a3522d9fa473 c35569a76c908682eb8e7e7ab8d9a3522d9fa473 src/testdir/test42.in^A', 0] resumed
:return ['', 0] made pending
:return ['', 0] resumed
:return ['', 0] made pending
:return ['', 0] resumed
:return ['diff --git src/testdir/test42.in src/testdir/test42.in^@index c35569a76..438a48055 100644^@Binary files src/testdir/test42.in and src/testdir/test42.in differ^@', 0
] made pending
:return ['diff --git src/testdir/test42.in src/testdir/test42.in^@index c35569a76..438a48055 100644^@Binary files src/testdir/test42.in and src/testdir/test42.in differ^@', 0
] resumed
:return  made pending
:return  resumed

dp shows:

diff --git i/src/testdir/test42.in w/src/testdir/test42.in
index c35569a76..438a48055 100644
Binary files i/src/testdir/test42.in and w/src/testdir/test42.in differ

It would be nice if there was some kind of feedback/indicator in that case, e.g. a "(binary)" after the filename then (after running the diff).

@tpope
Copy link
Owner

tpope commented Oct 17, 2019

I'm leaning towards doing :echo "Binary file" on attempting to expand, as I find putting stuff after the file name makes it a bit (just a bit) harder to scan.

@odnoletkov
Copy link
Sponsor Contributor

The same problem exists for submodules currently

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

No branches or pull requests

3 participants