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

Incompatible with fugitive, git-gutter, and git-signify #5

Open
goerz opened this issue Jan 7, 2019 · 4 comments
Open

Incompatible with fugitive, git-gutter, and git-signify #5

goerz opened this issue Jan 7, 2019 · 4 comments

Comments

@goerz
Copy link
Owner

goerz commented Jan 7, 2019

This plugin does not play nice with various git-related plugins such as fugitive, gitgutter and signify.

For gitgutter, bogus signs are shown, based on the output of

git diff --no-color --no-ext-diff -U0 -- <ipynbfile>

Personally, I already use nbdime as a diff tool for notebooks, but its output is (obviously) not valid for jupytext. Probably, the only solution is to create a diff tool based on jupytext that is used in the context of git-gutter only. This would probably depend on airblade/vim-gitgutter#568 as well.

Alternatively, one would probably want to just disable git-gutter for notebook files.

For signfiy, no signs are shown at all (presumably because it can detect that the generated patch is bogus?). In principle, the solution should be the same as for gitgutter, except that signfiy appears to be better set up to handle using a custom diff-tool for notebook files. However, that diff-tool would still need to exist.

The fugitive plugin appears simply inoperative (e.g. the Gdiff command is "not an editor command"). I'm not sure what it would take to fix this, but it seems like something that should be possible. For now, "inoperative" is a better place to be in than "broken".

@goerz
Copy link
Owner Author

goerz commented Jan 7, 2019

@goerz
Copy link
Owner Author

goerz commented Jan 7, 2019

A problem with git-gutter that will prevent this approach is the presence of --no-ext-diff in https://github.com/airblade/vim-gitgutter/blob/1d422b9f98194e38bc56e54192c9bc66d95c21f1/autoload/gitgutter/diff.vim#L135

Edit: actually, this can help in some way, as it disables the standard nbdime command, making place for a --textconv.

@goerz
Copy link
Owner Author

goerz commented Jan 7, 2019

In theory, assuming nbdime is installed, the following settings should make it work with git-gutter:

let g:gitgutter_git_args = "-c diff.jupyternotebook.textconv='jupytext --from=ipynb --to=md -o -'"
let g:gitgutter_diff_args = "--textconv"

Except that git-gutter tries to convert both the current buffer and the index to md, but this fails because the current buffer is already in md!

@BlueDrink9
Copy link

I think the better solution might be, instead of opening and writing the ipnb as different to the buffer, you auto-open the equivalent .py etc. That's the desired VCed file anyway in most cases, and prevents accidentally overwriting the ipynb file.

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

2 participants