-
Notifications
You must be signed in to change notification settings - Fork 2.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
VCS for git doesn't appear in worktree checkouts #816
Comments
Could you list the exact commands necessary to reproduce this? |
I am only able to reproduce this so far with a chromiumos checkout using worktrees. https://chromium.googlesource.com/chromiumos/docs/+/master/developer_guide.md#Get-the-source-code if you add --worktree to the |
Here's what I've tried: git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git ~/depot_tools
path=(~/depot_tools $path)
mkdir ~/chromiumos
cd ~/chromiumos
repo init -u https://chromium.googlesource.com/chromiumos/manifest.git --repo-url https://chromium.googlesource.com/external/repo.git --worktree
repo sync -j4
cd ~/chromiumos/src/chromium/src/tools/md_browser This gave me Which commands do I need to run to reproduce this problem? |
Hmm, that should have reproduced it. Is there any sort of debug I can dump to help identify the issue? |
I've reproduced it. I think on my previous attempt I've either forgot to pass Powerlevel10k uses gitstatus, and gitstatus for historical reasons relies on libgit2 for non-performance-critical operations, and that includes opening repositories. libgit2 cannot open repositories with Powerlevel10k will start supporting your use case when gitstatus start supporting it. The latter will happen either when libgit2 starts supporting Edit: I won't be implementing this myself. |
Thanks for the detailed explanation. |
+1 for this Compiling and using the latest gitstatusd still shows:
Strange thing is that I am not using worktrees but I am using sparse-checkout. I will open a case on gitstatusd for this. |
No need. #816 (comment) still applies except that I won't be adding support for |
Thanks for the detail on this. Is this the appropriate issue on the libgit2 side to track: libgit2/libgit2#6044 |
@seanabraham I don’t know. |
Since the embedded vcs/gitstatus in p10k doesn't work for git worktree. The custom prompt is ported from p10k.zsh my_git_formatter. See romkatv/powerlevel10k#816 for detail.
Would it be very hard to add a fallback? i.e. If the |
Very hard? Probably not. For someone with the level of zsh experience similar to my own it would probably take no more than 40 hours. |
Is that something that you would accept in your project? I could try and give it ago but my experience in zsh is close to nothing. |
If someone submits a clean PR (no bugs, good performance, matches the style and architecture of the existing code, etc.), I'll merge it. |
Well, count me as one. ;-) Curiously, I'm only having this problem for sparse repos, not for worktrees. That seems to be working fine |
Yeah same here |
See #816 (comment) above. No need to post "me too" comments. |
Oh sorry about that, I was aiming to just confirm that it is effecting only sparse repos but I see it was unnecessary. |
|
I'm on Windows with WSL2 with Debian and just updated git for windows to version 2.42.0 Unfortunately, still not seeing branch name and status indicator for worktrees. |
Please don't post "me too" comments here. They aren't helpful. |
The clean reproducer that someone just added and someone just deleted was certainly helpful |
It looks like the |
Update on this: it still doesn't work... in iTerm2. Even on a new machine with fresh installs of both iTerm2 and p10k, the repo I work on has this problem. It works fine in other terminal emulators I've tried on macOS — Terminal.app, WezTerm, Alacritty, even Warp. I've personally switched to WezTerm full time and am no longer experiencing issues. I don't know if the problem is with iTerm2 itself or the way p10k (internals and/or dependencies) acts when it detects it's being run in iTerm2. 🤷 |
The git status does not show up if you are in a work tree checkout.
See documentation here https://git-scm.com/docs/git-worktree
My guess is the system is confused by the fact that .git is a file not a folder and just ignoring it.
The text was updated successfully, but these errors were encountered: