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

expose command to customise git diff #89

Open
gennaro-tedesco opened this issue Sep 9, 2022 · 0 comments
Open

expose command to customise git diff #89

gennaro-tedesco opened this issue Sep 9, 2022 · 0 comments

Comments

@gennaro-tedesco
Copy link

gennaro-tedesco commented Sep 9, 2022

Perhaps a long shot, but worth asking! I see that there is an option g:git_messenger_git_command to specify the git executable: could there be a similar one to specify custom git options/scripts to pipe/execute when showing the git diff?

To clarify the rationale, the problem I am trying to solve is the following: when showing the file diff in the popup window (say pressing d/r) the text shown is presumably the output of git diff; in the case of a neovim popup I would not need all the git metadata that are part of a diff, for instance I would like to cut off the context lines or the chunk markers or any other similar thing: imagine something along the lines of

git diff -U0 <file> | tail +6

Now you could argue that one could simply specify the above options as general git configuration (which I assume the plugin uses), however I would only need such "special" config when in the popup window in neovim and keep the normal behaviour outside, for general git diff. Thus I thought one could expose a command along the lines of

let g:git_diff_command = 'git diff {} | tail +6'

with {} indicating the current buffer or such (to replicate my example above).

I understand this is probably complicated and likely nobody needs it, but again, worth asking! Thank you for the awesome plugin!

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

1 participant