From 29166a64b83b15185d58fbc44e07214dff46d8c4 Mon Sep 17 00:00:00 2001 From: Leonid Volnitsky Date: Wed, 11 Aug 2010 20:52:13 +0300 Subject: -- minore docs --- index.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'index.txt') diff --git a/index.txt b/index.txt index a0c3b84..d8dd50b 100644 --- a/index.txt +++ b/index.txt @@ -11,7 +11,7 @@ image:screenshot-prompt-basic.png[basic usage] Digit [red]*1* on 3rd line is `false(1)` exit code. Also on non-zero exit code -terminal bell is sounded. Bell is turnned off by default (to set softer +terminal bell is sounded. Bell is turned off by default (to set softer terminal bell use `setterm`). @@ -68,11 +68,11 @@ caption always "%{= kw}%-w%{= bw}%n %t%{-}%+w %-= @%H - %LD %d %LM - %c" == Simple AutoJump AutoJump is python script from Joel Schaerer providing shortcuts for jumping -to directories you once visited. Git-prompt have builtin, simplified -autojump. It is only about 10 lines of code (vs original 100+ LOC), there is -no database. It remembers only directories from current session. It selects -not most frequent dir, but last visited. Matches are done from beginning of of -dir name (not path name). +to directories you once visited. Git-prompt have built-in, simplified +autojump. It is only about 10 lines of bash code (vs original 100+ python +LOC), there is no database. It remembers only directories from current +session. It selects not most frequent dir, but last visited. Matches are done +from beginning of of dir name (not path name). ----------------- cd /tmp -- cgit v1.2.3 From 4625e6372e182dde1338fd70c4c97bef0548b9a6 Mon Sep 17 00:00:00 2001 From: Leonid Volnitsky Date: Sat, 29 Jan 2011 08:55:57 +0200 Subject: -- docs --- index.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'index.txt') diff --git a/index.txt b/index.txt index d8dd50b..61b68ea 100644 --- a/index.txt +++ b/index.txt @@ -27,8 +27,8 @@ image:screenshot-prompt-git.png[git module screenshot] | *Branch* | *File* | *Meaning* | [darkblue]#dark blue# | | Clean repo | [green]#green# | [green]#green# | Modified or new file. Modifications are in index but not in repo yet. -| [#cc0000]#dark red# | [#cc0000]#dark red# | Modified and tracked by repo, but modifications not added to index yet. -| [blue]#light blue# | [blue]#light blue# | Untracked file. +| [darkred]#dark red# | [darkred]#dark red# | Modified and tracked by repo, but modifications not added to index yet. +| [lightblue]#light blue# | [lightblue]#light blue# | Untracked file. | [red]#light red# | | Detached Head | [magenta]#magenta# | | In middle of doing something |================================================================ -- cgit v1.2.3 From 8d45f1fc7acdedc21d6ad141b281ecdd19a859ea Mon Sep 17 00:00:00 2001 From: Leonid Volnitsky Date: Sat, 29 Jan 2011 15:29:51 +0200 Subject: removed bash completion for git-prompt bash git completion can be enabled from .bash_profile. Put something following in your profile: [[ -f "/etc/bash_completion.d/git" ]] && . /etc/bash_completion.d/git [[ -f "/usr/share/bash-completion/git" ]] && . /usr/share/bash-completion/git --- git-prompt.sh | 20 +------------------- index.txt | 10 ---------- 2 files changed, 1 insertion(+), 29 deletions(-) (limited to 'index.txt') diff --git a/git-prompt.sh b/git-prompt.sh index 21f3610..021000f 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -15,6 +15,7 @@ conf=~/.config/git-prompt.conf; [[ -r $conf ]] && . $conf unset conf + ##### set defaults if not set git_module=${git_module:-on} @@ -384,24 +385,6 @@ parse_hg_status() { } -parse_git_complete() { - if [ "${BASH_VERSION%.*}" \< "3.0" ]; then - # echo "You will need to upgrade 'bash' to version 3.0 \ - # for full programmable completion features (bash complete) \ - # Please install bash-completion packet like: $ yum -y install bash-completion" - return - fi - - complete -f -W "$( - echo `git branch -a | sed -e s/[\ \*]//g | cut -f 1 -d ' ' | uniq`; \ - echo `git remote | sed -e s/[\ \*]//g | cut -f 1 -d ' ' | uniq`; \ - echo `git | tail -23 | head -21 | cut -d ' ' -f 4`; \ - echo '--help'; \ - echo '--staged'; \ - echo 'remote'; \ - echo 'help'; \ - )" g git -} parse_git_status() { @@ -414,7 +397,6 @@ parse_git_status() { [[ -n ${git_dir/./} ]] || return 1 vcs=git - parse_git_complete ########################################################## GIT STATUS file_regex='\([^/]*\/\{0,1\}\).*' diff --git a/index.txt b/index.txt index d8dd50b..ab786ba 100644 --- a/index.txt +++ b/index.txt @@ -87,16 +87,6 @@ j .*3 # same as cd "~/long dir mp3" ------------- -== Bash Completion - -Completion can be done for git subcommands, branches and remotes: - ---------------------- -git ch # expands to git checkout -git checkout ma # expands to git checkout master --------------------- - - == Install Download link:git-prompt.sh[] or get it with GIT: -- cgit v1.2.3 From 1b3fecb0ec15d93df942b4a99d35fd6b992e160a Mon Sep 17 00:00:00 2001 From: Leonid Volnitsky Date: Thu, 3 Mar 2011 14:49:15 +0200 Subject: -- docs --- index.txt | 4 ---- 1 file changed, 4 deletions(-) (limited to 'index.txt') diff --git a/index.txt b/index.txt index 3c816e2..b9b8cff 100644 --- a/index.txt +++ b/index.txt @@ -158,12 +158,8 @@ dependencies are standard unix utils. == Todo -* Subshells number indicator. Don't know how to do this. There is bash - `"\j"`, but let say I want `">>"` after path instead of `">"` when I have 2 jobs - running. Running `+++`jobs | ... `+++` is extra bash fork, hate to do this. * VIM module needs to be moved out of GIT module - include::../volnitsky.com/project/howto-submit-patch.txt[] Nobody will use git-prompt if there will be delay in prompt display. -- cgit v1.2.3 From f1627bab037d2ce5abb7fc86235b785874d79e02 Mon Sep 17 00:00:00 2001 From: Leonid Volnitsky Date: Fri, 13 May 2011 09:15:41 +0300 Subject: -- docs --- index.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'index.txt') diff --git a/index.txt b/index.txt index b9b8cff..4ed975b 100644 --- a/index.txt +++ b/index.txt @@ -176,6 +176,12 @@ time consuming ops in postconfig which is executed only once. - Martin httpx://github.com/jerrywho[] - Alexander Goldstein (emacs-shell, prompt chars) httpx://github.com/alexg0[] - Dmitry (bash completion) +- Sergey Shepelev +- Robert Wahler +- Gustavo Delfino +- Dan Bravender +- Thomas Geffert +- Tibor Simko [bibliography] -- cgit v1.2.3 From f2fd61de186cd32c448cb7ad55bad371453cb26d Mon Sep 17 00:00:00 2001 From: Leonid Volnitsky Date: Fri, 6 Jul 2012 16:59:07 +0300 Subject: -- --- index.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'index.txt') diff --git a/index.txt b/index.txt index 4ed975b..eaaa6cd 100644 --- a/index.txt +++ b/index.txt @@ -2,6 +2,9 @@ = GIT Prompt +* Repo: httpx://github.com/lvv/scc[GitHub], httpx://bitbucket.org/lvv/scc[BitBucket] + +* License: httpx://www.gnu.org/licenses/gpl-3.0.html[GPL3] + :v-p: http://volnitsky.com/project :compact-option: compact @@ -158,6 +161,9 @@ dependencies are standard unix utils. == Todo +* httpx://jonisalonen.com/2012/your-bash-prompt-needs-this/[] +* httpx://tldp.org/HOWTO/Bash-Prompt-HOWTO/x810.html[Beep after long running command] +* httpx://briancarper.net/blog/248/[Sync bash history] * VIM module needs to be moved out of GIT module include::../volnitsky.com/project/howto-submit-patch.txt[] -- cgit v1.2.3 From 38d69296430ae47f584d92b77c8c5f1e11273523 Mon Sep 17 00:00:00 2001 From: Leonid Volnitsky Date: Fri, 6 Jul 2012 19:09:13 +0300 Subject: get file status from "git status --porcelain" --- git-prompt.sh | 43 ++++++++++++------------------------------- index.txt | 10 +++++++++- 2 files changed, 21 insertions(+), 32 deletions(-) (limited to 'index.txt') diff --git a/git-prompt.sh b/git-prompt.sh index 41aa587..fae87a8 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -420,7 +420,7 @@ parse_git_status() { freshness="$dim" unset branch status modified added clean init added mixed untracked op detached - # quoting hell + # info not in porcelain status eval " $( git status 2>/dev/null | sed -n ' @@ -431,40 +431,21 @@ parse_git_status() { s/^# Your branch is ahead of .[/[:alnum:]]\+. by [[:digit:]]\+ commit.*/freshness=${WHITE}↑/p s/^# Your branch is behind .[/[:alnum:]]\+. by [[:digit:]]\+ commit.*/freshness=${YELLOW}↓/p s/^# Your branch and .[/[:alnum:]]\+. have diverged.*/freshness=${YELLOW}↕/p + ' + )" - /^# Changes to be committed:/,/^# [A-Z]/ { - s/^# Changes to be committed:/added=added;/p - - s/^# modified: '"$file_regex"'/ [[ \" ${added_files[*]} \" =~ \" \1 \" ]] || added_files[${#added_files[@]}]=\"\1\"/p - s/^# new file: '"$file_regex"'/ [[ \" ${added_files[*]} \" =~ \" \1 \" ]] || added_files[${#added_files[@]}]=\"\1\"/p - s/^# renamed:[^>]*> '"$file_regex"'/ [[ \" ${added_files[*]} \" =~ \" \1 \" ]] || added_files[${#added_files[@]}]=\"\1\"/p - s/^# copied:[^>]*> '"$file_regex"'/ [[ \" ${added_files[*]} \" =~ \" \1 \" ]] || added_files[${#added_files[@]}]=\"\1\"/p - } - - /^# Changed but not updated:/,/^# [A-Z]/ { - s/^# Changed but not updated:/modified=modified;/p - s/^# modified: '"$file_regex"'/ [[ \" ${modified_files[*]} \" =~ \" \1 \" ]] || modified_files[${#modified_files[@]}]=\"\1\"/p - s/^# unmerged: '"$file_regex"'/ [[ \" ${modified_files[*]} \" =~ \" \1 \" ]] || modified_files[${#modified_files[@]}]=\"\1\"/p - } - - /^# Changes not staged for commit:/,/^# [A-Z]/ { - s/^# Changes not staged for commit:/modified=modified;/p - s/^# modified: '"$file_regex"'/ [[ \" ${modified_files[*]} \" =~ \" \1 \" ]] || modified_files[${#modified_files[@]}]=\"\1\"/p - s/^# unmerged: '"$file_regex"'/ [[ \" ${modified_files[*]} \" =~ \" \1 \" ]] || modified_files[${#modified_files[@]}]=\"\1\"/p - } - - /^# Unmerged paths:/,/^[^#]/ { - s/^# Unmerged paths:/modified=modified;/p - s/^# both modified:\s*'"$file_regex"'/ [[ \" ${modified_files[*]} \" =~ \" \1 \" ]] || modified_files[${#modified_files[@]}]=\"\1\"/p - } - - /^# Untracked files:/,/^[^#]/{ - s/^# Untracked files:/untracked=untracked;/p - s/^# '"$file_regex"'/ [[ \" ${untracked_files[*]} ${modified_files[*]} ${added_files[*]} \" =~ \" \1 \" ]] || untracked_files[${#untracked_files[@]}]=\"\1\"/p - } + # porcelain file list + # TODO: sed-less -- http://tldp.org/LDP/abs/html/arrays.html -- Example 27-5 + eval " $( + git status --porcelain 2>/dev/null | + sed -n ' + s/^[MARC]. \(.*\)/ added=added; [[ \" ${added_files[*]} \" =~ \" \1 \" ]] || added_files[${#added_files[@]}]=\"\1\"/p + s/^.[MAU] \(.*\)/ modified=modified; [[ \" ${modified_files[*]} \" =~ \" \1 \" ]] || modified_files[${#modified_files[@]}]=\"\1\"/p + s/^?? \(.*\)/ untracked=untracked; [[ \" ${untracked_files[*]} \" =~ \" \1 \" ]] || untracked_files[${#untracked_files[@]}]=\"\1\"/p ' )" + if ! grep -q "^ref:" $git_dir/HEAD 2>/dev/null; then detached=detached fi diff --git a/index.txt b/index.txt index eaaa6cd..b75ae0a 100644 --- a/index.txt +++ b/index.txt @@ -108,7 +108,15 @@ Some distros also have `/etc/bashrc` or `/etc/bash/bashrc` with distro default prompt. -== Config +////////////////////////////// +== Git config + +git config [--global] core.quotepath off +git config [--global] --unset svn.pathnameencoding +git config [--global] --unset i18n.logoutputencoding +/////////////////////////////////// + +== Git-print config [[config]] Is optional. If config file is not found then git-prompt uses defaults. -- cgit v1.2.3 From d9c8684498d88d75c0cbc64bcde635eda4211c1c Mon Sep 17 00:00:00 2001 From: Leonid Volnitsky Date: Fri, 6 Jul 2012 19:18:38 +0300 Subject: -- docs --- index.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'index.txt') diff --git a/index.txt b/index.txt index b75ae0a..a48ab80 100644 --- a/index.txt +++ b/index.txt @@ -108,15 +108,19 @@ Some distros also have `/etc/bashrc` or `/etc/bash/bashrc` with distro default prompt. -////////////////////////////// -== Git config +== GIT config + +GIT-PROMPT requires following GIT's option to be set: + +------------------------- git config [--global] core.quotepath off git config [--global] --unset svn.pathnameencoding git config [--global] --unset i18n.logoutputencoding -/////////////////////////////////// +----------------------------- + -== Git-print config +== GIT-PROMPT config [[config]] Is optional. If config file is not found then git-prompt uses defaults. -- cgit v1.2.3