summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonid Volnitsky <Leonid@Volnitsky.com>2010-03-17 22:09:07 +0200
committerLeonid Volnitsky <Leonid@Volnitsky.com>2010-03-17 22:51:47 +0200
commitfad9f4f28a90cb744d6d76b3e2e4019572711ee4 (patch)
treefa65e59ec3f557401cf40e4fc3de58cc2f32ff79
parentgit autocompletion (diff)
downloadgit-prompt-fad9f4f28a90cb744d6d76b3e2e4019572711ee4.tar.gz
git-prompt-fad9f4f28a90cb744d6d76b3e2e4019572711ee4.tar.bz2
git-prompt-fad9f4f28a90cb744d6d76b3e2e4019572711ee4.zip
-- completion docs/cleanup
-rw-r--r--Makefile13
-rwxr-xr-xgit-prompt.sh20
-rw-r--r--index.txt15
3 files changed, 33 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 5fb2098..27631ce 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,16 @@
-HOMEDIR ?= /home/lvv/p/volnitsky.com/
-include $(HOMEDIR)/include.mk
+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:
cp -v git-prompt.sh /etc/
[ -f /etc/git-prompt.conf ] || cp -v git-prompt.conf /etc/
diff --git a/git-prompt.sh b/git-prompt.sh
index 83c2d76..a4c7216 100755
--- a/git-prompt.sh
+++ b/git-prompt.sh
@@ -379,11 +379,8 @@ parse_hg_status() {
vcs_info=${branch/default/D}
}
-alias g='git'
-# parse git complete
-parse_git_complete()
-{
+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) \
@@ -391,13 +388,14 @@ parse_git_complete()
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'; \
+ 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
}
diff --git a/index.txt b/index.txt
index b810288..a0c3b84 100644
--- a/index.txt
+++ b/index.txt
@@ -72,7 +72,7 @@ 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.
+dir name (not path name).
-----------------
cd /tmp
@@ -87,6 +87,16 @@ j .*3 # same as cd "~/long dir mp3"
-------------
+== Bash Completion
+
+Completion can be done for git subcommands, branches and remotes:
+
+---------------------
+git ch<tab> # expands to git checkout
+git checkout ma<tab> # expands to git checkout master
+--------------------
+
+
== Install
Download link:git-prompt.sh[] or get it with GIT:
@@ -174,11 +184,12 @@ time consuming ops in postconfig which is executed only once.
== Authors
- Leonid Volnitsky (original author) <leonid@volnitsky.com>, http://volnitsky.com
- Niklas Hofer (CWD truncation) <niklas+dev AT lanpartei.de>, httpx://github.com/niklas/[]
-- Lee Nussbaum (HG support) lee.nussbaum AT gmail.com, httpx://github.com/wln[]
+- Lee Nussbaum (HG support) <lee.nussbaum AT gmail.com>, httpx://github.com/wln[]
- Albert Vernon http://xenoclub.wordpress.com[]
- Amir Yalon httpx://github.com/amiryal[]
- Martin httpx://github.com/jerrywho[] <JerryWho AT gmx.de>
- Alexander Goldstein (emacs-shell, prompt chars) httpx://github.com/alexg0[]
+- Dmitry <uok AT gmx.net> (bash completion)
[bibliography]