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

git prompt broken for worktrees in v2.0 #658

Closed
andreimatei opened this issue Feb 16, 2021 · 4 comments
Closed

git prompt broken for worktrees in v2.0 #658

andreimatei opened this issue Feb 16, 2021 · 4 comments
Assignees
Labels
bug git Related to Git VCS data
Milestone

Comments

@andreimatei
Copy link

I used to get the git prompt when I was in a worktree dir (git worktree). Not any more; now it's as if I'm not inside a repo dir.
I've bisected to f434b6d

FWIW, git rev-parse --is-inside-work-tree properly detects the worktree.
It's easy to reproduce by creating a worktree (git worktree add <path>; cd <path>).

Thanks!

@Rycieos Rycieos self-assigned this Feb 16, 2021
@Rycieos
Copy link
Collaborator

Rycieos commented Feb 16, 2021

I'm currently on vacation, so responses might be slow.

Thanks for the clear report, and stupid simple reproduction steps.

Yeah, this one is a bit embarrassing. I have always wanted to use workdirs more often, but have been too lazy to really learn how they work. As a self proclamed Git expert, I really should have already known.

Anyway, good bisecting work. That commit moved away from using that 'is-work-tree' command all the time to determine if the current directory is a Git dir to instead looking for a '.git/' directory, since it is so much faster. But a workdir uses a '.git' file, so that match failed.

I pushed the above commit to add a check for that. Could you give it a test?

@Rycieos
Copy link
Collaborator

Rycieos commented Feb 22, 2021

@andreimatei any chance to test commit fc44d97?

@Rycieos Rycieos added this to the v2.0.2 milestone Feb 22, 2021
@andreimatei
Copy link
Author

Sorry for missing you previous message. The commit works.
Thanks!

@Rycieos Rycieos added the git Related to Git VCS data label Feb 22, 2021
@Rycieos
Copy link
Collaborator

Rycieos commented Feb 22, 2021

Fix released as part of v2.0.2.

pkkolos pushed a commit to pkkolos/liquidprompt that referenced this issue May 9, 2021
Git worktrees (see git worktree --help) are registered as .git _files_
instead of directories. This meant Liquidprompt would fail to detect
them. Since other VCSs do not have similar files, add a special case for
Git files like this.

Fixes liquidprompt#658
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug git Related to Git VCS data
Projects
None yet
Development

No branches or pull requests

2 participants