Unset the new variable. Documentation added in README.md Removed unexpected token warning.

master
oGre 10 years ago
parent 87ecc3cae9
commit 41aa8fe825
  1. 8
      README.md
  2. 4
      gitprompt.sh
  3. 1
      themes/Default.bgptheme

@ -60,7 +60,7 @@ The prompt may look like the following:
By default, the general appearance of the prompt is:: By default, the general appearance of the prompt is::
(<branch> <branch tracking>|<local status>) (<branch> <upstream branch> <branch tracking>|<local status>)
The symbols are as follows: The symbols are as follows:
@ -71,6 +71,10 @@ The symbols are as follows:
- ``✚n``: there are ``n`` changed but *unstaged* files - ``✚n``: there are ``n`` changed but *unstaged* files
- ``…n``: there are ``n`` untracked files - ``…n``: there are ``n`` untracked files
- ``⚑n``: there are ``n`` stash entries - ``⚑n``: there are ``n`` stash entries
- Upstream branch
- Shows the remote tracking branch
- Disabled by default
- Enable by setting GIT_PROMPT_SHOW_UPSTREAM=1
- Branch Tracking Symbols - Branch Tracking Symbols
- ``↑n``: ahead of remote by ``n`` commits - ``↑n``: ahead of remote by ``n`` commits
- ``↓n``: behind remote by ``n`` commits - ``↓n``: behind remote by ``n`` commits
@ -119,6 +123,8 @@ git clone https://github.com/magicmonty/bash-git-prompt.git .bash-git-prompt
# GIT_PROMPT_FETCH_REMOTE_STATUS=0 # uncomment to avoid fetching remote status # GIT_PROMPT_FETCH_REMOTE_STATUS=0 # uncomment to avoid fetching remote status
# GIT_PROMPT_SHOW_UPSTREAM=1 # uncomment to show upstream tracking branch
# GIT_PROMPT_START=... # uncomment for custom prompt start sequence # GIT_PROMPT_START=... # uncomment for custom prompt start sequence
# GIT_PROMPT_END=... # uncomment for custom prompt end sequence # GIT_PROMPT_END=... # uncomment for custom prompt end sequence

@ -435,6 +435,7 @@ function updatePrompt() {
export __GIT_PROMPT_IGNORE_STASH=${GIT_PROMPT_IGNORE_STASH} export __GIT_PROMPT_IGNORE_STASH=${GIT_PROMPT_IGNORE_STASH}
export __GIT_PROMPT_SHOW_UPSTREAM=${GIT_PROMPT_SHOW_UPSTREAM} export __GIT_PROMPT_SHOW_UPSTREAM=${GIT_PROMPT_SHOW_UPSTREAM}
local -a git_status_fields local -a git_status_fields
git_status_fields=($("$__GIT_STATUS_CMD" 2>/dev/null)) git_status_fields=($("$__GIT_STATUS_CMD" 2>/dev/null))
@ -533,7 +534,8 @@ function is_function {
#Helper function that truncates $PWD depending on window width #Helper function that truncates $PWD depending on window width
function gp_truncate_pwd { function gp_truncate_pwd {
local newPWD="${PWD/#$HOME/~}" local tilde="~"
local newPWD="${PWD/#${HOME}/${tilde}}"
local pwdmaxlen=$((${COLUMNS:-80}/3)) local pwdmaxlen=$((${COLUMNS:-80}/3))
[ ${#newPWD} -gt $pwdmaxlen ] && newPWD="...${newPWD:3-$pwdmaxlen}" [ ${#newPWD} -gt $pwdmaxlen ] && newPWD="...${newPWD:3-$pwdmaxlen}"
echo -n "$newPWD" echo -n "$newPWD"

@ -17,6 +17,7 @@ unset_git_prompt_colors() {
unset GIT_PROMPT_COMMAND_OK unset GIT_PROMPT_COMMAND_OK
unset GIT_PROMPT_COMMAND_FAIL unset GIT_PROMPT_COMMAND_FAIL
unset GIT_PROMPT_VIRTUALENV unset GIT_PROMPT_VIRTUALENV
unset GIT_PROMPT_UPSTREAM
unset GIT_PROMPT_START_USER unset GIT_PROMPT_START_USER
unset GIT_PROMPT_START_ROOT unset GIT_PROMPT_START_ROOT
unset GIT_PROMPT_END_USER unset GIT_PROMPT_END_USER

Loading…
Cancel
Save