From c328f70ddea9f9fa0ee2e2e306e5ce9e60541316 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Tue, 26 Apr 2011 23:41:00 -0400 Subject: [PATCH 01/25] Makefile cambiando la forma de instalar --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 27631ce..97e25bb 100644 --- a/Makefile +++ b/Makefile @@ -12,8 +12,7 @@ COPY_LIST = git-prompt.sh install: - cp -v git-prompt.sh /etc/ - [ -f /etc/git-prompt.conf ] || cp -v git-prompt.conf /etc/ + [ -f $(HOME)/.git-prompt.conf ] || ln -s $(shell pwd)/git-prompt.conf $(HOME)/.git-prompt.conf tgit: xclip -i git-demo From eba1ba5dd7bb1751a7821a223aa613e7c4439e85 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Wed, 27 Apr 2011 01:14:29 -0400 Subject: [PATCH 02/25] fijando algunos colores --- .gitignore | 1 + Makefile | 2 +- git-prompt.conf | 23 ++++++++++++----------- git-prompt.sh | 6 ++++-- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 827d95c..8d481d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.html +*swp # emacs backup and lock files *~ diff --git a/Makefile b/Makefile index 97e25bb..7534734 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ COPY_LIST = git-prompt.sh install: - [ -f $(HOME)/.git-prompt.conf ] || ln -s $(shell pwd)/git-prompt.conf $(HOME)/.git-prompt.conf + [ -f $(HOME)/.git-prompt.conf ] || ln -v -s $(shell pwd)/git-prompt.conf $(HOME)/.git-prompt.conf tgit: xclip -i git-demo diff --git a/git-prompt.conf b/git-prompt.conf index 986e6af..31b00ba 100644 --- a/git-prompt.conf +++ b/git-prompt.conf @@ -30,13 +30,14 @@ ########################################################### Current Working Dir display # cwd_cmd='\w' # display full path -## cwd_cmd='\W' # display only last dir of path +# cwd_cmd='\W' # display only last dir of path ## cwd_cmd='cwd_truncate 40' # display only last N chars of path ########################################################### ETC # Some don't like hostname in uppercase # upcase_hostname=on # =off +upcase_hostname=off # Do not do VCS parsing for listed directories # useful for directories for which it is difficult to maintain .gitignore so @@ -47,21 +48,21 @@ ### directory, exit code, root color -# cols=`tput colors` -# if [[ -n "$cols" && $cols -ge 8 ]]; then # if terminal supports colors - # dir_color=CYAN - # rc_color=red - # user_id_color=blue - # root_id_color=magenta -# else # B/W terminal - # dir_color=bw_bold - # rc_color=bw_bold +cols=`tput colors` +# if [[ -n "$cols" && $cols -ge 8 ]]; then # if terminal supports colors + dir_color=white + rc_color=red + user_id_color=white + #root_id_color=magenta +# else # B/W terminal + #dir_color=bw_bold + #rc_color=bw_bold # fi ### prompt character for root/non-root, default '>' for both # prompt_char='>' # root_prompt_char='>' -## prompt_char='$' + prompt_char='$' ## root_prompt_char='#' ##### Per host color diff --git a/git-prompt.sh b/git-prompt.sh index 2708eb6..760b59a 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -289,8 +289,8 @@ set_shell_label() { # if { for ((pid=$$; $pid != 1 ; pid=`ps h -o pid --ppid $pid`)); do ps h -o command -p $pid; done | grep -q sshd && echo == REMOTE ==; } #then - host=${HOSTNAME} - #host=`hostname -s` + #host=${HOSTNAME} + host=`hostname -s` host=${host#$default_host} uphost=`echo ${host} | tr a-z A-Z` if [[ $upcase_hostname = "on" ]]; then @@ -304,6 +304,8 @@ set_shell_label() { color_index=(green yellow blue magenta cyan white) # FIXME: bw, color-256 host_color=${color_index[cksum_color_no]} fi + #host_color fix in white + host_color=white host_color=${!host_color} From 0126f3a4cf2d5794fdd8e4438872c8975c49cc19 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sun, 26 Jun 2011 13:05:08 -0400 Subject: [PATCH 03/25] add folder markers --- git-prompt.sh | 49 ++++++++++++++++--------------------------------- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/git-prompt.sh b/git-prompt.sh index 74e5d40..bd0ad84 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -224,7 +224,7 @@ cwd_truncate() { } -set_shell_label() { +set_shell_label() { #{{{ xterm_label() { echo -n "]2;${@}" ; } # FIXME: replace hardcodes with terminfo codes @@ -254,7 +254,7 @@ set_shell_label() { ;; esac fi - } + } #}}} export -f set_shell_label @@ -343,9 +343,7 @@ set_shell_label() { else color_who_where='' fi - - -parse_svn_status() { +parse_svn_status() { #{{{ [[ -d .svn ]] || return 1 @@ -373,9 +371,8 @@ parse_svn_status() { [[ -z $modified ]] && [[ -z $untracked ]] && clean=clean vcs_info=svn:r$rev - } - -parse_hg_status() { + } #}}} +parse_hg_status() { #{{{ # ☿ @@ -399,11 +396,8 @@ parse_hg_status() { [[ -z $modified ]] && [[ -z $untracked ]] && [[ -z $added ]] && clean=clean vcs_info=${branch/default/D} - } - - - -parse_git_status() { + } #}}} +parse_git_status() { #{{{ # TODO add status: LOCKED (.git/index.lock) @@ -550,10 +544,8 @@ parse_git_status() { vcs_info="$branch$freshness$rawhex" fi - } - - -parse_vcs_status() { + } #}}} +parse_vcs_status() { #{{{ unset file_list modified_files untracked_files added_files unset vcs vcs_info @@ -633,14 +625,12 @@ parse_vcs_status() { head_local="${head_local+$vcs_color$head_local }" #above_local="${head_local+$vcs_color$head_local\n}" #tail_local="${tail_local+$vcs_color $tail_local}${dir_color}" - } - -disable_set_shell_label() { + } #}}} +disable_set_shell_label() { #{{{ trap - DEBUG >& /dev/null - } - + } #}}} # show currently executed command in label -enable_set_shell_label() { +enable_set_shell_label() { #{{{ disable_set_shell_label # check for BASH_SOURCE being empty, no point running set_shell_label on every line of .bashrc trap '[[ -z "$BASH_SOURCE" && ($BASH_COMMAND != prompt_command_function) ]] && @@ -664,13 +654,10 @@ j (){ fi done echo '?' - } - + } #}}} alias jumpstart='echo ${aj_dir_list[@]}' - ###################################################################### PROMPT_COMMAND - -prompt_command_function() { +prompt_command_function() { #{{{ rc="$?" if [[ "$rc" == "0" ]]; then @@ -696,12 +683,8 @@ prompt_command_function() { PS1="$colors_reset$rc$head_local$color_who_where$dir_color$cwd$tail_local$dir_color$prompt_char $colors_reset" unset head_local tail_local pwd - } - + } #}}} PROMPT_COMMAND=prompt_command_function - enable_set_shell_label - unset rc id tty modified_files file_list - # vim: set ft=sh ts=8 sw=8 et: From 6c3dc1480d2c856a894e42770e6c699573b97505 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sun, 26 Jun 2011 17:56:00 -0400 Subject: [PATCH 04/25] begin monitoring of remotes branchs --- git-prompt.sh | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/git-prompt.sh b/git-prompt.sh index bd0ad84..384464d 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -506,7 +506,31 @@ parse_git_status() { #{{{ # branch="$(git describe --exact-match HEAD 2>/dev/null)" || \ # branch="$(cut -c1-7 "$git_dir/HEAD")..." fi - + # TODO : make this a module on/off + # hourly checks new commits in remotes + fetchUpdate=3600 + remotes=() + for remote in $(git remote) + do + if [[ ! -e $git_dir/FETCH_HEAD ]]; then + git fetch $remote >& /dev/null & + else + fetchDate=$(date --utc --reference=.git/FETCH_HEAD +%s) + now=$(date --utc +%s) + delta=$(( $now - $fetchDate )) + # if last update to .git/FETCH_HEAD file + if [[ $delta -gt $fetchUpdate ]]; then + git fetch $remote >& /dev/null & + fi + fi + if [[ $(git branch -a | grep $remote) != "" ]]; then + if [[ -f $git_dir/FETCH_HEAD && $(git log --oneline HEAD..$remote/master) != "" ]]; then + remotes+=" "$remote:$(git log --oneline HEAD..$remote/master | wc -l) + fi + else + git fetch $remote >& /dev/null & + fi + done #### GET GIT HEX-REVISION if [[ $rawhex_len -gt 0 ]] ; then @@ -619,7 +643,7 @@ parse_vcs_status() { #{{{ fi - head_local="$vcs_color(${vcs_info}$vcs_color${file_list}$vcs_color)" + head_local="$vcs_color(${vcs_info}$vcs_color${file_list}$vcs_color$remotes)" ### fringes head_local="${head_local+$vcs_color$head_local }" From ee32d1bef0ff7cbafffe16110d2cef87ed253daf Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sun, 26 Jun 2011 18:26:33 -0400 Subject: [PATCH 05/25] when remote is origin show o: --- git-prompt.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/git-prompt.sh b/git-prompt.sh index 384464d..c3bd45c 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -524,8 +524,13 @@ parse_git_status() { #{{{ fi fi if [[ $(git branch -a | grep $remote) != "" ]]; then - if [[ -f $git_dir/FETCH_HEAD && $(git log --oneline HEAD..$remote/master) != "" ]]; then - remotes+=" "$remote:$(git log --oneline HEAD..$remote/master | wc -l) + nRemoteCommit=$(git log --oneline HEAD..$remote/master | wc -l) + if [[ -f $git_dir/FETCH_HEAD && $nRemoteCommit != "0" ]]; then + if [[ $remote == "origin" ]]; then + remotes+=" o:"$nRemoteCommit + else + remotes+=" "$remote:$nRemoteCommit + fi fi else git fetch $remote >& /dev/null & From 5dd8de58397639d4e4548c8f0951c883c31c9576 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sun, 26 Jun 2011 19:35:36 -0400 Subject: [PATCH 06/25] unset remotes --- git-prompt.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/git-prompt.sh b/git-prompt.sh index c3bd45c..041b0ba 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -9,6 +9,7 @@ unset dir_color rc_color user_id_color root_id_color init_vcs_color clean_vcs_color unset modified_vcs_color added_vcs_color addmoded_vcs_color untracked_vcs_color op_vcs_color detached_vcs_color hex_vcs_color unset rawhex_len + unset remotes conf=git-prompt.conf; [[ -r $conf ]] && . $conf conf=/etc/git-prompt.conf; [[ -r $conf ]] && . $conf From 75205c32239d438bdb8ddb354f5798e861cf8600 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sun, 26 Jun 2011 20:00:58 -0400 Subject: [PATCH 07/25] unset remotes;changed position --- git-prompt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-prompt.sh b/git-prompt.sh index 041b0ba..64cca6b 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -9,7 +9,6 @@ unset dir_color rc_color user_id_color root_id_color init_vcs_color clean_vcs_color unset modified_vcs_color added_vcs_color addmoded_vcs_color untracked_vcs_color op_vcs_color detached_vcs_color hex_vcs_color unset rawhex_len - unset remotes conf=git-prompt.conf; [[ -r $conf ]] && . $conf conf=/etc/git-prompt.conf; [[ -r $conf ]] && . $conf @@ -581,6 +580,7 @@ parse_vcs_status() { #{{{ unset vcs vcs_info unset status modified untracked added init detached unset file_list modified_files untracked_files added_files + unset remotes [[ $vcs_ignore_dir_list =~ $PWD ]] && return From 137dbad7bf97d3eb80be5719a44f6e6978a1b642 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sun, 26 Jun 2011 20:12:10 -0400 Subject: [PATCH 08/25] fixed bad route to .git --- git-prompt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-prompt.sh b/git-prompt.sh index 64cca6b..e8d0725 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -515,7 +515,7 @@ parse_git_status() { #{{{ if [[ ! -e $git_dir/FETCH_HEAD ]]; then git fetch $remote >& /dev/null & else - fetchDate=$(date --utc --reference=.git/FETCH_HEAD +%s) + fetchDate=$(date --utc --reference=$git_dir/FETCH_HEAD +%s) now=$(date --utc +%s) delta=$(( $now - $fetchDate )) # if last update to .git/FETCH_HEAD file From 8cc86bafa125f2e136800512f191ed9481d16496 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sun, 26 Jun 2011 22:10:49 -0400 Subject: [PATCH 09/25] remote origin o --- git-prompt.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/git-prompt.sh b/git-prompt.sh index e8d0725..7413691 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -526,11 +526,7 @@ parse_git_status() { #{{{ if [[ $(git branch -a | grep $remote) != "" ]]; then nRemoteCommit=$(git log --oneline HEAD..$remote/master | wc -l) if [[ -f $git_dir/FETCH_HEAD && $nRemoteCommit != "0" ]]; then - if [[ $remote == "origin" ]]; then - remotes+=" o:"$nRemoteCommit - else - remotes+=" "$remote:$nRemoteCommit - fi + remotes+=" "${remote/origin/o}:$nRemoteCommit fi else git fetch $remote >& /dev/null & From ed28d3e87480696a436137386d7af7ca0333e7e2 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sun, 26 Jun 2011 22:31:28 -0400 Subject: [PATCH 10/25] only in the master branch --- git-prompt.sh | 55 +++++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/git-prompt.sh b/git-prompt.sh index 7413691..0909a78 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -506,32 +506,35 @@ parse_git_status() { #{{{ # branch="$(git describe --exact-match HEAD 2>/dev/null)" || \ # branch="$(cut -c1-7 "$git_dir/HEAD")..." fi - # TODO : make this a module on/off - # hourly checks new commits in remotes - fetchUpdate=3600 - remotes=() - for remote in $(git remote) - do - if [[ ! -e $git_dir/FETCH_HEAD ]]; then - git fetch $remote >& /dev/null & - else - fetchDate=$(date --utc --reference=$git_dir/FETCH_HEAD +%s) - now=$(date --utc +%s) - delta=$(( $now - $fetchDate )) - # if last update to .git/FETCH_HEAD file - if [[ $delta -gt $fetchUpdate ]]; then - git fetch $remote >& /dev/null & - fi - fi - if [[ $(git branch -a | grep $remote) != "" ]]; then - nRemoteCommit=$(git log --oneline HEAD..$remote/master | wc -l) - if [[ -f $git_dir/FETCH_HEAD && $nRemoteCommit != "0" ]]; then - remotes+=" "${remote/origin/o}:$nRemoteCommit - fi - else - git fetch $remote >& /dev/null & - fi - done + if [[ $branch == "master" ]]; then + # Only work with master branch + # TODO : make this a module on/off + # hourly checks new commits in remotes + fetchUpdate=3600 + remotes=() + for remote in $(git remote) + do + if [[ ! -e $git_dir/FETCH_HEAD ]]; then + git fetch $remote >& /dev/null & + else + fetchDate=$(date --utc --reference=$git_dir/FETCH_HEAD +%s) + now=$(date --utc +%s) + delta=$(( $now - $fetchDate )) + # if last update to .git/FETCH_HEAD file + if [[ $delta -gt $fetchUpdate ]]; then + git fetch $remote >& /dev/null & + fi + fi + if [[ $(git branch -a | grep $remote) != "" ]]; then + nRemoteCommit=$(git log --oneline HEAD..$remote/master | wc -l) + if [[ -f $git_dir/FETCH_HEAD && $nRemoteCommit != "0" ]]; then + remotes+=" "${remote/origin/o}:$nRemoteCommit + fi + else + git fetch $remote >& /dev/null & + fi + done + fi #### GET GIT HEX-REVISION if [[ $rawhex_len -gt 0 ]] ; then From 42850e2b0330d2a89ea8852df66c6a5762e9b885 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Mon, 27 Jun 2011 17:34:45 -0400 Subject: [PATCH 11/25] Makefile : install , clean ; REDME.md --- Makefile | 26 ++++++++------------------ README | 5 ----- README.md | 5 +++++ 3 files changed, 13 insertions(+), 23 deletions(-) delete mode 100644 README create mode 100644 README.md diff --git a/Makefile b/Makefile index 7534734..7cb1774 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,10 @@ -ifeq ($(USER),lvv) - HOMEDIR := /home/lvv/p/volnitsky.com/ - INCLUDE := $(HOMEDIR)/include.mk -else - INCLUDE := /dev/null -endif - -include $(INCLUDE) - - -COPY_LIST = git-prompt.sh - - install: [ -f $(HOME)/.git-prompt.conf ] || ln -v -s $(shell pwd)/git-prompt.conf $(HOME)/.git-prompt.conf - -tgit: - xclip -i git-demo - echo "ready to paste ..." - + @echo + @echo 'add to ~/.bashrc' + @echo '[[ $$- == *i* ]] && . $(PWD)/git-prompt.sh' +clean: + [ -f $(HOME)/.git-prompt.conf ] && unlink $(HOME)/.git-prompt.conf + @echo + @echo 'remove in ~/.bashrc' + @echo '[[ $$- == *i* ]] && . $(PWD)/git-prompt.sh' diff --git a/README b/README deleted file mode 100644 index 0937cc0..0000000 --- a/README +++ /dev/null @@ -1,5 +0,0 @@ -GIT Prompt for BASH - -Screenshots and docs are at: http://volnitsky.com/project/git-prompt - - diff --git a/README.md b/README.md new file mode 100644 index 0000000..04db143 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +#GIT Prompt for BASH + +Forked from [lvv-git-prompt](https://github.com/lvv/git-prompt) + +Screenshots and docs are at: [volnitsky.com](http://volnitsky.com/project/git-prompt) From eeaae516400b068175d1d36262286d46300b6020 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sat, 2 Jul 2011 15:06:13 -0400 Subject: [PATCH 12/25] a screenshot --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 04db143..1fe4918 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,7 @@ Forked from [lvv-git-prompt](https://github.com/lvv/git-prompt) Screenshots and docs are at: [volnitsky.com](http://volnitsky.com/project/git-prompt) + +### Screenshots + +![prompt-git](https://github.com/juanpabloaj/git-prompt/raw/master/screenshot-prompt-git.png) From 70e539b3ea189ab1823e44ed072ce671af452323 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sat, 2 Jul 2011 15:10:50 -0400 Subject: [PATCH 13/25] screenshot for svn --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1fe4918..da7b060 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,15 @@ -#GIT Prompt for BASH +# GIT Prompt for BASH Forked from [lvv-git-prompt](https://github.com/lvv/git-prompt) Screenshots and docs are at: [volnitsky.com](http://volnitsky.com/project/git-prompt) -### Screenshots +# Screenshots + +### prompt-git ![prompt-git](https://github.com/juanpabloaj/git-prompt/raw/master/screenshot-prompt-git.png) + +### prompt-svn + +![prompt-svn](https://github.com/juanpabloaj/git-prompt/blob/master/screenshot-svn.png) From 0aa0c9b71358ee2844a13ec41688016aaaae1bb8 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sat, 2 Jul 2011 15:12:04 -0400 Subject: [PATCH 14/25] from blob to raw --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index da7b060..1989667 100644 --- a/README.md +++ b/README.md @@ -12,4 +12,4 @@ Screenshots and docs are at: [volnitsky.com](http://volnitsky.com/project/git-pr ### prompt-svn -![prompt-svn](https://github.com/juanpabloaj/git-prompt/blob/master/screenshot-svn.png) +![prompt-svn](https://github.com/juanpabloaj/git-prompt/raw/master/screenshot-svn.png) From 66a1020ebf75a03584b8e5fcd587f6d71db4491a Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sat, 2 Jul 2011 15:13:12 -0400 Subject: [PATCH 15/25] sin linea --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1989667..b8ff734 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Forked from [lvv-git-prompt](https://github.com/lvv/git-prompt) Screenshots and docs are at: [volnitsky.com](http://volnitsky.com/project/git-prompt) -# Screenshots +## Screenshots ### prompt-git From 7cc976bd86b877565995fec7f95283c09d9b7065 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sat, 2 Jul 2011 15:27:38 -0400 Subject: [PATCH 16/25] README to markdown --- README | 5 ----- README.md | 13 +++++++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) delete mode 100644 README create mode 100644 README.md diff --git a/README b/README deleted file mode 100644 index 0937cc0..0000000 --- a/README +++ /dev/null @@ -1,5 +0,0 @@ -GIT Prompt for BASH - -Screenshots and docs are at: http://volnitsky.com/project/git-prompt - - diff --git a/README.md b/README.md new file mode 100644 index 0000000..253a2d6 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# GIT Prompt for BASH + +More screenshots and docs are at: http://volnitsky.com/project/git-prompt + +##Screenshots + +### prompt-git + +![prompt-git](https://github.com/lvv/git-prompt/raw/master/screenshot-prompt-git.png) + +### prompt-svn + +![prompt-svn](https://github.com/lvv/git-prompt/raw/master/screenshot-svn.png) From b5b5049f77294df70672b69e5c88d9ff27fa1d6f Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sun, 3 Jul 2011 23:40:14 -0400 Subject: [PATCH 17/25] ignoring Done message #13 in subshell --- git-prompt.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git-prompt.sh b/git-prompt.sh index 6345a5f..f93481d 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -511,14 +511,14 @@ parse_git_status() { #{{{ for remote in $(git remote) do if [[ ! -e $git_dir/FETCH_HEAD ]]; then - git fetch $remote >& /dev/null & + ( git fetch $remote >& /dev/null &) else fetchDate=$(date --utc --reference=$git_dir/FETCH_HEAD +%s) now=$(date --utc +%s) delta=$(( $now - $fetchDate )) # if last update to .git/FETCH_HEAD file if [[ $delta -gt $fetchUpdate ]]; then - git fetch $remote >& /dev/null & + ( git fetch $remote >& /dev/null &) fi fi if [[ $(git branch -a | grep $remote) != "" ]]; then @@ -527,7 +527,7 @@ parse_git_status() { #{{{ remotes+=" "${remote/origin/o}:$nRemoteCommit fi else - git fetch $remote >& /dev/null & + (git fetch $remote >& /dev/null &) fi done fi From 27fe45de73f7f4d57ebc0bde05224969e6ee8575 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sun, 3 Jul 2011 23:58:56 -0400 Subject: [PATCH 18/25] ignoring Done message --- git-prompt.sh | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/git-prompt.sh b/git-prompt.sh index 69f3c4a..4caa9cf 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -337,8 +337,6 @@ set_shell_label() { else color_who_where='' fi - - parse_svn_status() { [[ -d .svn ]] || return 1 @@ -368,7 +366,6 @@ parse_svn_status() { [[ -z $modified ]] && [[ -z $untracked ]] && clean=clean vcs_info=svn:r$rev } - parse_hg_status() { # ☿ @@ -394,9 +391,6 @@ parse_hg_status() { [[ -z $modified ]] && [[ -z $untracked ]] && [[ -z $added ]] && clean=clean vcs_info=${branch/default/D} } - - - parse_git_status() { # TODO add status: LOCKED (.git/index.lock) @@ -515,14 +509,14 @@ parse_git_status() { for remote in $(git remote) do if [[ ! -e $git_dir/FETCH_HEAD ]]; then - git fetch $remote >& /dev/null & + ( git fetch $remote >& /dev/null &) else fetchDate=$(date --utc --reference=$git_dir/FETCH_HEAD +%s) now=$(date --utc +%s) delta=$(( $now - $fetchDate )) # if last update to .git/FETCH_HEAD file if [[ $delta -gt $fetchUpdate ]]; then - git fetch $remote >& /dev/null & + ( git fetch $remote >& /dev/null &) fi fi if [[ $(git branch -a | grep $remote) != "" ]]; then @@ -531,7 +525,7 @@ parse_git_status() { remotes+=" "${remote/origin/o}:$nRemoteCommit fi else - git fetch $remote >& /dev/null & + (git fetch $remote >& /dev/null &) fi done fi @@ -573,8 +567,6 @@ parse_git_status() { fi } - - parse_vcs_status() { unset file_list modified_files untracked_files added_files @@ -657,11 +649,9 @@ parse_vcs_status() { #above_local="${head_local+$vcs_color$head_local\n}" #tail_local="${tail_local+$vcs_color $tail_local}${dir_color}" } - disable_set_shell_label() { trap - DEBUG >& /dev/null } - # show currently executed command in label enable_set_shell_label() { disable_set_shell_label @@ -688,11 +678,8 @@ j (){ done echo '?' } - alias jumpstart='echo ${aj_dir_list[@]}' - ###################################################################### PROMPT_COMMAND - prompt_command_function() { rc="$?" @@ -720,11 +707,7 @@ prompt_command_function() { unset head_local tail_local pwd } - PROMPT_COMMAND=prompt_command_function - enable_set_shell_label - unset rc id tty modified_files file_list - # vim: set ft=sh ts=8 sw=8 et: From d1ce45a335455bc4519d48ddf0596f0892a2cd09 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Tue, 5 Jul 2011 17:17:00 -0400 Subject: [PATCH 19/25] make install : reescribir links --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7cb1774..a14d566 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ install: - [ -f $(HOME)/.git-prompt.conf ] || ln -v -s $(shell pwd)/git-prompt.conf $(HOME)/.git-prompt.conf + [ -f $(HOME)/.git-prompt.conf ] || ln -vfn -s $(shell pwd)/git-prompt.conf $(HOME)/.git-prompt.conf @echo @echo 'add to ~/.bashrc' @echo '[[ $$- == *i* ]] && . $(PWD)/git-prompt.sh' From e266a6f5220ba58404aad7da991c62efbc103b32 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Fri, 9 Sep 2011 17:28:49 -0400 Subject: [PATCH 20/25] hostname command in cygwin --- git-prompt.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/git-prompt.sh b/git-prompt.sh index ad0a40d..d314acc 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -298,7 +298,11 @@ set_shell_label() { #{{{ host=${HOSTNAME} if [[ $short_hostname = "on" ]]; then - host=`hostname -s` + if [[ "$(uname)" =~ "CYGWIN" ]]; then + host=`hostname` + else + host=`hostname -s` + fi fi host=${host#$default_host} uphost=`echo ${host} | tr a-z A-Z` From 277288a167ff13b07ab2ef095333dd9abb05bfab Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Mon, 17 Oct 2011 17:53:23 -0300 Subject: [PATCH 21/25] gitremotes added --- .gitremotes | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitremotes diff --git a/.gitremotes b/.gitremotes new file mode 100644 index 0000000..67cbb50 --- /dev/null +++ b/.gitremotes @@ -0,0 +1,4 @@ +lvv git://github.com/lvv/git-prompt.git (fetch) +lvv git://github.com/lvv/git-prompt.git (push) +origin git@github.com:juanpabloaj/git-prompt.git (fetch) +origin git@github.com:juanpabloaj/git-prompt.git (push) From eae25b49036e0adcd5da4ae53da9e37a751dafdd Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sun, 9 Sep 2012 14:09:04 -0300 Subject: [PATCH 22/25] nombre corto para directorio --- git-prompt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-prompt.conf b/git-prompt.conf index deeb6bd..c827dcc 100644 --- a/git-prompt.conf +++ b/git-prompt.conf @@ -31,7 +31,7 @@ vim_module=on ########################################################### Current Working Dir display # cwd_cmd='\w' # display full path -# cwd_cmd='\W' # display only last dir of path +cwd_cmd='\W' # display only last dir of path ## cwd_cmd='cwd_truncate 40' # display only last N chars of path ########################################################### ETC From 5b178463d896c8b7ff5f7a3a4f74cf6613378fff Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Mon, 17 Mar 2014 18:51:48 -0300 Subject: [PATCH 23/25] README sin espacios en blanco innecesarios --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b8ff734..10b72a6 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ # GIT Prompt for BASH -Forked from [lvv-git-prompt](https://github.com/lvv/git-prompt) +Forked from [lvv-git-prompt](https://github.com/lvv/git-prompt) Screenshots and docs are at: [volnitsky.com](http://volnitsky.com/project/git-prompt) -## Screenshots +## Screenshots ### prompt-git ![prompt-git](https://github.com/juanpabloaj/git-prompt/raw/master/screenshot-prompt-git.png) - + ### prompt-svn ![prompt-svn](https://github.com/juanpabloaj/git-prompt/raw/master/screenshot-svn.png) From 2552f9802058385addc2b611bc71783e1edbe056 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Mon, 17 Mar 2014 19:19:02 -0300 Subject: [PATCH 24/25] git-prompt.sh sin espacion en blancos innecesarios --- git-prompt.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git-prompt.sh b/git-prompt.sh index 388c9e6..881569c 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -512,10 +512,10 @@ parse_git_status() { # branch="$(cut -c1-7 "$git_dir/HEAD")..." fi if [[ $branch == "master" ]]; then - # Only work with master branch + # Only work with master branch # TODO : make this a module on/off # hourly checks new commits in remotes - fetchUpdate=3600 + fetchUpdate=3600 remotes=() for remote in $(git remote) do @@ -525,7 +525,7 @@ parse_git_status() { fetchDate=$(date --utc --reference=$git_dir/FETCH_HEAD +%s) now=$(date --utc +%s) delta=$(( $now - $fetchDate )) - # if last update to .git/FETCH_HEAD file + # if last update to .git/FETCH_HEAD file if [[ $delta -gt $fetchUpdate ]]; then ( git fetch $remote >& /dev/null &) fi From bed5ec2fcef6529a9961d554e238a1d55b6eb7fc Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sun, 7 Feb 2016 14:49:09 -0300 Subject: [PATCH 25/25] hex hash in white and with 6 digits --- git-prompt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-prompt.sh b/git-prompt.sh index 1498d36..9872f15 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -66,14 +66,14 @@ op_vcs_color=${op_vcs_color:-MAGENTA} detached_vcs_color=${detached_vcs_color:-RED} - hex_vcs_color=${hex_vcs_color:-BLACK} # gray + hex_vcs_color=${hex_vcs_color:-white} max_file_list_length=${max_file_list_length:-100} short_hostname=${short_hostname:-off} upcase_hostname=${upcase_hostname:-on} count_only=${count_only:-off} - rawhex_len=${rawhex_len:-5} + rawhex_len=${rawhex_len:-6} aj_max=20