-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[BUG][git_status][git_metrics] With Worktree. Status displays as if all files are gone #6417
Labels
🐛 bug
Something isn't working as expected.
Comments
Please post the output of |
Here are the results. I navigated a bit the folders that starship provided hoping that would help as well debug it. Logs running `STARSHIP_LOG=trace starship module git_metrics`esave/worktree/code on pin-image-sha -665292 [$9✘2850?18] via v23.2.0 via 🐍 v3.13.0 via 💎 v2.7.5
❯ STARSHIP_LOG=trace starship module git_metrics
[TRACE] - (starship): Parsed arguments: Cli {
command: Module {
name: Some(
"git_metrics",
),
list: false,
properties: Properties {
status_code: None,
pipestatus: None,
terminal_width: 80,
path: None,
logical_path: None,
cmd_duration: None,
keymap: "viins",
jobs: 0,
},
},
}
[TRACE] - (starship::utils): Trying to read from "/Users/alexrecuenco/.config/starship-debug.toml"
[TRACE] - (starship::utils): File read successfully
[TRACE] - (starship::config): Config file content: "
[git_metrics]
disabled = false
ignore_submodules = true
[git_status]
conflicted = "=${count}"
untracked = "?${count}"
stashed = "\\$${count}"
modified = "!${count}"
staged = "+${count}"
renamed = "»${count}"
deleted = "✘${count}"
ahead = '⇡${count}'
behind = '⇣${count}'
diverged = '⇕⇡${ahead_count}⇣${behind_count}'
"
[DEBUG] - (starship::config): Config parsed: {"git_metrics": Table({"disabled": Boolean(false), "ignore_submodules": Boolean(true)}), "git_status": Table({"conflicted": String("=${count}"), "untracked": String("?${count}"), "stashed": String("\\$${count}"), "modified": String("!${count}"), "staged": String("+${count}"), "renamed": String("»${count}"), "deleted": String("✘${count}"), "ahead": String("⇡${count}"), "behind": String("⇣${count}"), "diverged": String("⇕⇡${ahead_count}⇣${behind_count}")})}
[TRACE] - (starship::context): Received completed pipestatus of None
[DEBUG] - (starship::config): Config found for "git_metrics": Some(Table({"disabled": Boolean(false), "ignore_submodules": Boolean(true)}))
[TRACE] - (starship::context): Found git repo: Repository { kind: Submodule, git_dir: "/Volumes/Workspace/new-workspace/.git/modules/code/worktrees/code", work_dir: Some("/Volumes/Workspace/new-workspace/.git/modules/code") }, (trust: Full)
[TRACE] - (starship::utils): Creating Command for binary "git"
[TRACE] - (starship::utils): Using "/opt/homebrew/bin/git" as "git"
[TRACE] - (starship::context): Executing git command: GIT_OPTIONAL_LOCKS="0" "/opt/homebrew/bin/git" "-C" "/Volumes/Workspace/esave/worktree/code" "--git-dir" "/Volumes/Workspace/new-workspace/.git/modules/code/worktrees/code" "-c" "core.fsmonitor=" "--work-tree" "/Volumes/Workspace/new-workspace/.git/modules/code" "diff" "--shortstat" "--ignore-submodules"
[TRACE] - (starship::utils): stdout: " 2850 files changed, 665292 deletions(-)\n", stderr: "", exit code: "Some(0)", took 261.455916ms
[TRACE] - (starship::config): No color palette specified, using defaults
[TRACE] - (starship::config): Parsing color_string: red
[TRACE] - (starship::config): Read predefined color: red
esave/worktree/code on pin-image-sha -665292 [$9✘2850?18] via v23.2.0 via 🐍 v3.13.0 via 💎 v2.7.5
❯ GIT_OPTIONAL_LOCKS="0" "/opt/homebrew/bin/git" "-C" "/Volumes/Workspace/esave/worktree/code" "--git-dir" "/Volumes/Workspace/new-workspace/.git/modules/code/worktrees/code" "-c" "core.fsmonitor=" "--work-tree" "/Volumes/Workspace/new-workspace/.git/modules/code" "diff" "--shortstat" "--ignore-submodules"
2850 files changed, 665292 deletions(-)
esave/worktree/code on pin-image-sha -665292 [$9✘2850?18] via v23.2.0 via 🐍 v3.13.0 via 💎 v2.7.5
❯ cd /Volumes/Workspace/new-workspace/.git/modules/code/worktrees/code
code/worktrees/code on pin-image-sha -665292 [$9✘2850?18]
❯ ls
COMMIT_EDITMSG FETCH_HEAD HEAD MERGE_RR ORIG_HEAD commondir gitdir index logs refs
code/worktrees/code on pin-image-sha -665292 [$9✘2850?18]
❯ git status
fatal: this operation must be run in a work tree
code/worktrees/code on pin-image-sha -665292 [$9✘2850?18]
❯ cd ..
modules/code/worktrees on reduce-number-of-jobs [$9]
❯ git status
On branch reduce-number-of-jobs
Your branch is up to date with 'origin/reduce-number-of-jobs'.
nothing to commit, working tree clean
modules/code/worktrees on reduce-number-of-jobs [$9]
❯ cd ..
.git/modules/code on reduce-number-of-jobs [$9]
❯ cd ..
new-workspace/.git/modules on debug-attach +4 -3 [!6]
❯ git status
fatal: this operation must be run in a work tree
new-workspace/.git/modules on debug-attach +4 -3 [!6]
❯ cd ..
new-workspace/.git on debug-attach +4 -3 [!6]
❯ git status
fatal: this operation must be run in a work tree
new-workspace/.git on debug-attach +4 -3 [!6]
❯ cd ..
new-workspace on debug-attach +4 -3 [!6]
❯ git status
On branch debug-attach
Your branch is based on 'origin/debug-attach', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: api-contract (new commits)
modified: code (new commits)
modified: frontend (new commits)
modified: global-view/esave.code-workspace
modified: iframe (new commits)
modified: landing-page (new commits)
no changes added to commit (use "git add" and/or "git commit -a")
new-workspace on debug-attach +4 -3 [!6]
❯ ls
README.md code docs iframe ingress.files.dev reports
api-contract compose.debug.yml frontend images landing-page
certs compose.yml global-view ingress rails.files.dev
new-workspace on debug-attach +4 -3 [!6]
❯ cd code
code on reduce-number-of-jobs [$9] via v23.2.0 via 🐍 v3.13.0 via 💎 v2.7.5
❯ git status
On branch reduce-number-of-jobs
Your branch is up to date with 'origin/reduce-number-of-jobs'.
nothing to commit, working tree clean
code on reduce-number-of-jobs [$9] via v23.2.0 via 🐍 v3.13.0 via 💎 v2.7.5
❯ cd /Volumes/Workspace/esave/worktree/code
esave/worktree/code on pin-image-sha -665292 [$9✘2850?18] via v23.2.0 via 🐍 v3.13.0 via 💎 v2.7.5
❯ git status
On branch pin-image-sha
Your branch is up to date with 'origin/pin-image-sha'.
nothing to commit, working tree clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current Behavior
First of all, I love
starship
Steps to reproduce
new-workspace
that contains some submodulescode
a new worktreegit worktree add ../../corp/worktree/deleteme temp
In my terminal,
git status
works fine! (And vscode also reports this with no issues)However starship reports like this:
..../worktree/code on main -664219 [$8✘2839?17] via v23.2.0 via 🐍 v3.11.10 via 💎 v2.7.5
Again,
git status
reports empty (See below, I tried a few times)Expected Behavior
code on main [$8] via v23.2.0 via 🐍 v3.11.10 via 💎 v2.7.5
Additional context/Screenshots
Logs
Possible Solution
I have no idea
Environment
I minimized my configurations to the minimum reproducible set
Relevant Shell Configuration
Starship Configuration
The text was updated successfully, but these errors were encountered: