Skip to content

fix acidhub prompt to properly handle bare git repo - #12808

Open
PommeDeTerre0 wants to merge 1 commit into
fish-shell:masterfrom
PommeDeTerre0:fix-acidhub-bare-repo
Open

fix acidhub prompt to properly handle bare git repo#12808
PommeDeTerre0 wants to merge 1 commit into
fish-shell:masterfrom
PommeDeTerre0:fix-acidhub-bare-repo

Conversation

@PommeDeTerre0

Copy link
Copy Markdown

Fixes #12807

TODOs:

  • If addressing an issue, a commit message mentions Fixes issue #<issue-number>
  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

@krobelus krobelus added this to the fish 4.8 milestone Jun 8, 2026
set git_branch (set_color -o blue)"$git_branch"
set -l git_status
if git rev-parse --quiet --verify HEAD >/dev/null
and not git rev-parse --is-bare-repository >/dev/null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this is the right spot but the fix is not quite right, since the bare status is echoed on stdout, not via the exit code. Check how fish_git_prompt does it (set -l repo_info), it's quite neat because it minimizes the Git invocations.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I did not know about that, I just guessed my way into making it work by looking at how tings were done in acidhub 😅

Looks like the rest of the acidhub conditional logic around git should be upgraded to match what's done in fish_git_prompt. I'll take a look a it

@krobelus krobelus removed this from the fish 4.8 milestone Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Acidhub prompt does not handle bare git repo correctly

2 participants