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

Diffing does not work #1294

Closed
krassowski opened this issue Nov 10, 2023 · 5 comments · Fixed by #1304
Closed

Diffing does not work #1294

krassowski opened this issue Nov 10, 2023 · 5 comments · Fixed by #1304
Assignees
Labels

Comments

@krassowski
Copy link
Member

Description

Clicking on "diff" button in the panel does nothing for me. Nor does selecting diff from context menu. This happens on both files and notebooks. There is no error message. Other buttons (open/discard/stage) work well. Clicking nbdime git button shows me a diff correctly.

If it works for you maybe it is a transitive problem on my machine, but in that case error propagation is off.

Context

0.50.0rc0

@krassowski krassowski added the bug label Nov 10, 2023
@fcollonval
Copy link
Member

I don't have any issue. If you have the chance to try again that will be great.

@krassowski
Copy link
Member Author

I still see this issue, both locally and on binder. Here is the gist: https://gist.github.com/krassowski/847732eb6c16e168fb4c0b16d9706142

repro

Tested with both JupyterLab 4.0.9 and 4.1.0a3 in Chrome 119.0.6045.105 and Firefox 119.0.1. Happens with both files and notebooks.

@krassowski
Copy link
Member Author

This is not UI issue as the command gets invoked. The problem appears to be that pathRepository is an empty string:

image.

However, elsewhere pathRepository is compared against null not just for whether it is truthy. You may not see the issue if your root dir is different from git repo dir.

@krassowski
Copy link
Member Author

This is good:

isEnabled: () => gitModel.pathRepository !== null,
execute: () => {
if (gitModel.pathRepository === null) {

This is the wrong code IMO:

if (!gitModel.pathRepository) {
return;
}

This may be bad too:

jupyterlab-git/src/model.ts

Lines 363 to 365 in d152a60

if (!this.pathRepository) {
return new BranchMarker(() => {});
}

@fcollonval
Copy link
Member

Thanks for investigating this one more. Indeed I missed it because I almost never run it at within a repository to test different test repositories locally. I'll push a fix.

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

Successfully merging a pull request may close this issue.

2 participants