Skip to content

Permit opting out of branch name truncation - #483

Open
chiphogg wants to merge 2 commits into
romkatv:masterfrom
chiphogg:truncation-opt-out#481
Open

chiphogg wants to merge 2 commits into
romkatv:masterfrom
chiphogg:truncation-opt-out#481

Conversation

@chiphogg

@chiphogg chiphogg commented Dec 7, 2025

Copy link
Copy Markdown

Users can now add this line before sourcing the script:

export GITSTATUS_USE_FULL_BRANCH_NAME=1

If they do, branch names will not be truncated, no matter their length.

Fixes #481.

Users can now add this line before sourcing the script:

```bash
export GITSTATUS_USE_FULL_BRANCH_NAME=1
```

If they do, branch names will not be truncated, no matter their length.

Fixes romkatv#481.
aauren added a commit to aauren/gitstatus that referenced this pull request Sep 10, 2026
The bundled prompts cut branch names and tags longer than 32 characters
down to the first and last 12 with an ellipsis in between, and there was
no way to turn that off short of copying gitstatus_prompt_update into
your rc file. Setting GITSTATUS_USE_FULL_BRANCH_NAME=1 before sourcing
gitstatus.prompt.sh or gitstatus.prompt.zsh now keeps the full name.

This is PR romkatv#483 by chiphogg, mirrored in the zsh prompt for symmetry.
One change from the PR: it treated any non-empty value as on, so
GITSTATUS_USE_FULL_BRANCH_NAME=0 would also disable truncation. Here the
value has to be 1, which is how GITSTATUS_ENABLE_LOGGING already works
in both plugins.

The fixture sources the real prompt scripts under bash and zsh against
the daemon under test. The zsh half runs under zsh/zpty because
gitstatus_start does setopt monitor, which needs a controlling tty.

Based on romkatv#483 by chiphogg.
Thanks for the good starting point.
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.

How to show full branch name?

1 participant