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

GitLens cannot show file changes from an interactive rebase todo #3310

Open
Chudesnov opened this issue May 20, 2024 · 0 comments
Open

GitLens cannot show file changes from an interactive rebase todo #3310

Chudesnov opened this issue May 20, 2024 · 0 comments
Labels
bug Something isn't working triage Needs to be looked at

Comments

@Chudesnov
Copy link

Chudesnov commented May 20, 2024

Description

When using VSCode as the editor for interactive rebase (git rebase -i), commands like "open changes" when activated from a commit details side panel spawned by clicking on a commit hash inside an interactive rebase preview (/path/to/repo/.git/worktrees/worktree-name/rebase-merge/git-rebase-todo), often fail, producing errors like:

Open File - Unable to open "relative/path"
Unable to open working file. File could not be found in the working tree

When they do work, the path displayed for the file at relative/path matches the main worktree (/path/to/repo/...) rather than the current worktree (/path/to/worktree/...), unlike when "Open changes with previous revision" is called from the context of an editor with the working directory inside the worktree (/path/to/worktree/relative/)

Looks like it might be caused by incorrectly identified worktree paths when opening git-rebase-todo, see the console output below.

Expected behavior

Instead of using the /path/to/repo/.git/worktrees/worktree-name/rebase-merge/ path inferred from the location of the git-rebase-todo file and trying to get the worktree location using rev-parse --show-toplevel, it should either explicitly use the path from .git/worktrees/worktree-name/gitdir or use a different mechanism that doesn't rely on the working directory being outside of .git.

GitLens Version

15.0.3

VS Code Version

Version: 1.89.1
Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685
Date: 2024-05-07T05:14:24.611Z (1 wk ago)
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Darwin x64 23.4.0

Git Version

git version 2.44.0

Logs, Screenshots, Screen Captures, etc

[2024-05-20 12:54:12.715] [     10ms] [/path/to/repo/.git/worktrees/worktree-name/rebase-merge] git rev-parse --show-toplevel • FAILED

Error: Command failed: /usr/local/bin/git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
fatal: this operation must be run in a work tree
@Chudesnov Chudesnov added bug Something isn't working triage Needs to be looked at labels May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Needs to be looked at
Projects
None yet
Development

No branches or pull requests

1 participant