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

No Git history for selected file #1024

Closed
willyyang opened this issue Sep 1, 2021 · 8 comments · Fixed by #1028
Closed

No Git history for selected file #1024

willyyang opened this issue Sep 1, 2021 · 8 comments · Fixed by #1028
Assignees
Labels

Comments

@willyyang
Copy link

Description

Unable to view Git history for a selected file. Implemented in 02c6d9a for #864

Reproduce

  1. Clone an active repo
  2. Right click on a file (containing history) and navigate to Git -> History
  3. No history found shows on file

Expected behavior

Expect to view a number of Git history commits based on the value set for historyCount under advanced settings (kept default of 25)

Context

# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"

# pip list | grep jupyterlab-git
jupyterlab-git         0.32.2

# jupyter labextension list
JupyterLab v3.0.17
  @jupyterlab/git v0.32.2 enabled OK (python, jupyterlab-git)

# jupyter server extension list
  jupyterlab_git enabled
  - Validating jupyterlab_git...
     jupyterlab_git 0.32.2 OK

# git --version
git version 2.20.1
@willyyang willyyang added the bug label Sep 1, 2021
@adammclaurin
Copy link

@navn-r fyi

@navn-r
Copy link
Collaborator

navn-r commented Sep 1, 2021

Thanks @willyyang for pointing out the issue and thanks @adammclaurin for pinging me on it.

The bug is definitely reproducible on my side. One thing to note that is the file history works when right clicking on the file in the Git Panel. But you'd need to have modified the file in order to do so, so I can't say to do that as a fix/workaround.

I've found that doing something like this internally should do the trick.

git -C cloned-repo-folder log ...

-C is the flag to specify the exact git folder, source

I'd be more than glad to get a PR in for it. @fcollonval is there any other approach we could take? Considering the regular repository history works as intended.

@fcollonval
Copy link
Member

Hey @willyyang thanks for reporting the bug. Could you confirm the workflow leading to the bug?

  1. Clone a repository using the Git menu or Git clone button of the filebrowser
  2. Navigate inside the cloned repository with the filebrowser
  3. Right-click on a file and select the context menu entry Git -> History
  4. The Git history panel appears but it displays an error instead of the expected file history

Are you using the standard file browser or a custom extension?

@willyyang
Copy link
Author

willyyang commented Sep 2, 2021

Hey @fcollonval , I'm using the standard file browser .
For 4, there is no error displayed just No history found.

@fcollonval fcollonval self-assigned this Sep 2, 2021
fcollonval added a commit to fcollonval/jupyterlab-git that referenced this issue Sep 2, 2021
@fcollonval
Copy link
Member

Hey @fcollonval , I'm using the standard file browser .
For 4, there is no error displayed just No history found.

Thanks for the quick answer. I pushed a fix.

fcollonval added a commit that referenced this issue Sep 3, 2021
* No Git history for selected file
Fixes #1024

* No context menu item if not in a repository
@willyyang
Copy link
Author

Thanks for the quick fix @fcollonval . I see a new release tag has been cut, when will this change be published?

@fcollonval
Copy link
Member

Initially I wanted to do a release right away. But the new merge conflict view (that is part of master) is not ready yet for publication (remaining tasks are tracked in #1031).

But I may branch out to cut a patch release for this one.

fcollonval added a commit to fcollonval/jupyterlab-git that referenced this issue Sep 12, 2021
* No Git history for selected file
Fixes jupyterlab#1024

* No context menu item if not in a repository
fcollonval added a commit that referenced this issue Sep 12, 2021
* No Git history for selected file
Fixes #1024

* No context menu item if not in a repository
@fcollonval
Copy link
Member

@willyyang I released 0.32.3 with the 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.

4 participants