From 7c98572bf67e58db0322ea96a97d6ca9a7b330d4 Mon Sep 17 00:00:00 2001 From: Ingo Haschler Date: Thu, 16 Oct 2014 16:50:45 +0200 Subject: [PATCH 1/7] Fix git symbolic-ref call; option short is no more... --- bash-powerline.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash-powerline.sh b/bash-powerline.sh index 6b11e3f..f83ea3c 100644 --- a/bash-powerline.sh +++ b/bash-powerline.sh @@ -69,7 +69,7 @@ __powerline() { [ -x "$(which git)" ] || return # git not found # get current branch name or short SHA1 hash for detached head - local branch="$(git symbolic-ref --short HEAD 2>/dev/null || git describe --tags --always 2>/dev/null)" + local branch="$(git symbolic-ref HEAD 2>/dev/null | sed -e s#refs/heads/## || git describe --tags --always 2>/dev/null)" [ -n "$branch" ] || return # git branch not found local marks From b986dca534f7ffb947e3ae66e1d6ea636526710f Mon Sep 17 00:00:00 2001 From: Ingo Haschler Date: Thu, 16 Oct 2014 17:08:20 +0200 Subject: [PATCH 2/7] Fixed ahead/behind count. --- bash-powerline.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bash-powerline.sh b/bash-powerline.sh index f83ea3c..a1017fa 100644 --- a/bash-powerline.sh +++ b/bash-powerline.sh @@ -78,9 +78,8 @@ __powerline() { [ -n "$(git status --porcelain)" ] && marks+=" $GIT_BRANCH_CHANGED_SYMBOL" # how many commits local branch is ahead/behind of remote? - local stat="$(git status --porcelain --branch | grep '^##' | grep -o '\[.\+\]$')" - local aheadN="$(echo $stat | grep -o 'ahead \d\+' | grep -o '\d\+')" - local behindN="$(echo $stat | grep -o 'behind \d\+' | grep -o '\d\+')" + local aheadN="$(git status | grep 'ahead' | grep -P -o '\d+')" + local behindN="$(git status | grep 'behind' | grep -P -o '\d+')" [ -n "$aheadN" ] && marks+=" $GIT_NEED_PUSH_SYMBOL$aheadN" [ -n "$behindN" ] && marks+=" $GIT_NEED_PULL_SYMBOL$behindN" From ed4fc67f0d7aaa92588dcd435ec353eb8f611a90 Mon Sep 17 00:00:00 2001 From: Ingo Haschler Date: Fri, 18 Sep 2015 12:21:08 +0200 Subject: [PATCH 3/7] Fixed download url. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 14acf20..95086ac 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Powerline for Bash in pure Bash script. Download the Bash script - curl https://raw.github.com/riobard/bash-powerline/master/bash-powerline.sh > ~/.bash-powerline.sh + curl https://raw.github.com/ingoha/bash-powerline/master/bash-powerline.sh > ~/.bash-powerline.sh And source it in your `.bashrc` From 4e1ebff652308edd6c2f6004b4c41bbe68ebc2c8 Mon Sep 17 00:00:00 2001 From: Ingo Haschler Date: Fri, 18 Sep 2015 12:30:44 +0200 Subject: [PATCH 4/7] Fixed url again... --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 95086ac..e0ec17e 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Powerline for Bash in pure Bash script. Download the Bash script - curl https://raw.github.com/ingoha/bash-powerline/master/bash-powerline.sh > ~/.bash-powerline.sh + curl https://raw.githubusercontent.com/ingoha/bash-powerline/master/bash-powerline.sh > ~/.bash-powerline.sh And source it in your `.bashrc` From 12feeada3035cdd9b04368a2cc95a6119a24513c Mon Sep 17 00:00:00 2001 From: Ingo Haschler Date: Sat, 19 Sep 2015 17:44:04 +0200 Subject: [PATCH 5/7] Added important hint for terminal color capability. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index e0ec17e..ddc7058 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,10 @@ And source it in your `.bashrc` source ~/.bash-powerline.sh +You need a terminal capable of displaying at least 16 colors. By default, this is not the case in Ubuntu and Mint. Therefore add this to your `.bashrc`: + + | export TERM=xterm-256color + For best result, use [Solarized colorscheme](https://github.com/altercation/solarized) for your terminal emulator. Or hack your own colorscheme by modifying the script. It's really From f403b6047c4bd4d62cdf591e6b727cda847ec8ca Mon Sep 17 00:00:00 2001 From: Ingo Haschler Date: Sat, 19 Sep 2015 17:45:29 +0200 Subject: [PATCH 6/7] Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ddc7058..e15296d 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ And source it in your `.bashrc` You need a terminal capable of displaying at least 16 colors. By default, this is not the case in Ubuntu and Mint. Therefore add this to your `.bashrc`: - | export TERM=xterm-256color + export TERM=xterm-256color For best result, use [Solarized colorscheme](https://github.com/altercation/solarized) for your terminal From 3924925b8c4e6551d66ef5a624f6f7c4c5db1c7b Mon Sep 17 00:00:00 2001 From: Ingo Haschler Date: Tue, 22 Sep 2015 14:59:11 +0200 Subject: [PATCH 7/7] Fixed ahead/behind count again. Forcing default locale --- bash-powerline.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash-powerline.sh b/bash-powerline.sh index a1017fa..ea4fd72 100644 --- a/bash-powerline.sh +++ b/bash-powerline.sh @@ -78,8 +78,8 @@ __powerline() { [ -n "$(git status --porcelain)" ] && marks+=" $GIT_BRANCH_CHANGED_SYMBOL" # how many commits local branch is ahead/behind of remote? - local aheadN="$(git status | grep 'ahead' | grep -P -o '\d+')" - local behindN="$(git status | grep 'behind' | grep -P -o '\d+')" + local aheadN="$(LC_ALL=C git status | grep 'ahead' | grep -P -o '\d+')" + local behindN="$(LC_ALL=C git status | grep 'behind' | grep -P -o '\d+')" [ -n "$aheadN" ] && marks+=" $GIT_NEED_PUSH_SYMBOL$aheadN" [ -n "$behindN" ] && marks+=" $GIT_NEED_PULL_SYMBOL$behindN"