Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,16 @@ script that uses these bindings to assemble git prompt.

Note: Bash bindings, unlike Zsh bindings, don't support asynchronous calls.

Note: Even the above customization method won't prevent gitstatus from truncating the branch name
that is displayed in the prompt. To disable truncation, add this line in your `.bashrc` before
sourcing any gitstatus script:

```bash
export GITSTATUS_USE_FULL_BRANCH_NAME=1
```

This method will work for both customized prompts, and the default prompt.

## Using from other shells

If there are no gitstatusd bindings for your shell, you'll need to get your hands dirty.
Expand Down
11 changes: 10 additions & 1 deletion gitstatus.prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,16 @@ function gitstatus_prompt_update() {
where="${VCS_STATUS_COMMIT:0:8}"
fi

(( ${#where} > 32 )) && where="${where:0:12}…${where: -12}" # truncate long branch names and tags
# Truncate long branch names and tags.
#
# To opt out of truncation, add this line to your `.bashrc` before sourcing
# this script:
#
# export GITSTATUS_USE_FULL_BRANCH_NAME=1
if [[ -z "${GITSTATUS_USE_FULL_BRANCH_NAME-}" ]]; then
(( ${#where} > 32 )) && where="${where:0:12}…${where: -12}"
fi

p+="${clean}${where}"

# ⇣42 if behind the remote.
Expand Down