Skip to content

Export a Git diff command#47

Open
da-x wants to merge 1 commit intojunegunn:masterfrom
da-x:git-diff
Open

Export a Git diff command#47
da-x wants to merge 1 commit intojunegunn:masterfrom
da-x:git-diff

Conversation

@da-x
Copy link

@da-x da-x commented Jun 18, 2018

GV current shows various Git diffs (unlike vim-fugitive, whichonly shows database objects), so it makes sense to export this functionality, say, for viewing the diff against HEAD or the index.

For instance:

:call gv#diff("HEAD")

:call gv#diff("--cached", "HEAD")

GV current shows various Git diffs (unlike vim-fugitive, which
only shows database objects), so it makes sense to export
this functionality, say, for viewing the diff against HEAD
or the index.

For instance:

   :call gv#diff("HEAD")

   :call gv#diff("--cached", "HEAD")
@justinmk
Copy link
Contributor

Doesn't fugitive already provide this? :Gdiff ... for the current file or :Git diff ... for the whole repo.

@da-x
Copy link
Author

da-x commented Jun 20, 2018

Yes, the vimdiff-based Gdiff works with vim-fugitive, however sometimes I just want a quick glance at the unidiff-based format of the diff in a split window, which is what gv good at.

@justinmk
Copy link
Contributor

Did you try :Git diff ... (not :Gdiff) ?

@da-x
Copy link
Author

da-x commented Jun 20, 2018

Yes, however that halts Vim to spawn Git. I think the gv diff buffer in a split window has some benefits over it.

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 this pull request may close these issues.

2 participants