Add option to omit the Git branch#618
Open
tim-harding wants to merge 5 commits intoIlanCosman:mainfrom
Open
Conversation
ff3548b to
dbfb250
Compare
Include new configuration variable in all of the presets.
b7e769a to
c722049
Compare
added 3 commits
December 22, 2025 15:42
> If a named capture group matched an empty string, > the variable will be set to the empty string (like `set var ""`). > If it did not match, > the variable will be set to nothing (like `set var`). https://fishshell.com/docs/current/cmds/string-match.html Use + instead of * to only create variables for non-empty strings. Otherwise, ``` (set_color black)$my_var ``` still emits a value when my_var is the empty string. This prepares the following commit. If we don't do this, then we end up with a bunch of extra spacing because git signs that are not present still create list items.
The previous version assumes that the location will be there, so the leading space before each sign works. However, this assumption breaks when the location is omitted, resulting in extra leading space. To fix this, create each item without padding and concatenate them with spaces.
Delete the location variable if the branch is configured to be hidden.
c722049 to
dd5e388
Compare
dd5e388 to
1b95868
Compare
Author
|
I've done my best to give you a structured history with reasoning behind each change. Let me know if you have any questions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Showing the Git branch name in the prompt is redundant to the working directory when using Git worktrees to manage feature branches.
Closes #617
Screenshots
How Has This Been Tested
Checklist