diff options
author | Leonid Volnitsky <Leonid@Volnitsky.com> | 2011-05-17 08:31:13 +0300 |
---|---|---|
committer | Leonid Volnitsky <Leonid@Volnitsky.com> | 2011-05-17 08:31:13 +0300 |
commit | 8d1db1b91724db1b4dd386cc87e866a45d93637c (patch) | |
tree | 4f7777d2d384bcd594a2090fa9c22ffc939a233b | |
parent | -- commit test (diff) | |
parent | short hostname cleanup (diff) | |
download | git-prompt-8d1db1b91724db1b4dd386cc87e866a45d93637c.tar.gz git-prompt-8d1db1b91724db1b4dd386cc87e866a45d93637c.tar.bz2 git-prompt-8d1db1b91724db1b4dd386cc87e866a45d93637c.zip |
Merge branch 'master' of github.com:lvv/git-prompt
-rw-r--r-- | git-prompt.conf | 2 | ||||
-rwxr-xr-x | git-prompt.sh | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/git-prompt.conf b/git-prompt.conf index 9f59e8f..81ddec9 100644 --- a/git-prompt.conf +++ b/git-prompt.conf @@ -37,6 +37,8 @@ # Some don't like hostname in uppercase # upcase_hostname=on # =off +# Some don't like long hostname +# short_hostname=off # =on # Do not do VCS parsing for listed directories # useful for directories for which it is difficult to maintain .gitignore so diff --git a/git-prompt.sh b/git-prompt.sh index 3025f95..28e2de6 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -62,6 +62,7 @@ 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} @@ -297,7 +298,9 @@ set_shell_label() { #then host=${HOSTNAME} - #host=`hostname -s` + if [[ $short_hostname = "on" ]]; then + host=`hostname -s` + fi host=${host#$default_host} uphost=`echo ${host} | tr a-z A-Z` if [[ $upcase_hostname = "on" ]]; then |