From d92e40f3ae6db4694d3d78344c9530dc79b012cc Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Fri, 31 Jul 2009 09:51:43 +0200 Subject: [Funcs] removes the trailing '^0' for named-revs --- 01_Functions.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '01_Functions.zsh') diff --git a/01_Functions.zsh b/01_Functions.zsh index 5ec09fd..4c376c9 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -100,7 +100,7 @@ get_git_branch () # If not on a working GIT branch, get the named current commit-ish inside parenthesis [ "$my_git_branch" = "(no branch)" ] &&\ checkouted_branch="" && \ - my_git_branch="$(git-name-rev --name-only HEAD 2>&- | sed 's,^tags/,,;s,^remotes/,,')" + my_git_branch="$(git-name-rev --name-only HEAD 2>&- | sed 's,^tags/,,;s,^remotes/,,;s,\^0$,,')" # If neither on a named commit-ish, show commit-id if [ "$my_git_branch" = "undefined" ] -- cgit v1.2.3 From eddf06b830b2ff5422515c9df76322e567f18f8e Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Fri, 31 Jul 2009 09:52:59 +0200 Subject: [Funcs] When only when .when exists. Yeah, really. --- 01_Functions.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '01_Functions.zsh') diff --git a/01_Functions.zsh b/01_Functions.zsh index 4c376c9..e1370e8 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -272,7 +272,7 @@ set_prompt_colors () chpwd() { - if cmd_exists when + if cmd_exists when && [ -e .when/birthdays ] then LATEST=`stat 2>&- --printf="%z\n" .when/.today | cut -d' ' -f1` TODAY=`date "+%Y-%m-%d"` -- cgit v1.2.3 From dd33ef436cdd4aab59fb38239417a4f5ef804a17 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 1 Oct 2009 17:14:35 +0200 Subject: [Funcs] protects 'lastjob' var with double-quotes to avoid 'set' command call upon a fg. --- 01_Functions.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '01_Functions.zsh') diff --git a/01_Functions.zsh b/01_Functions.zsh index e1370e8..983f5c0 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -30,7 +30,7 @@ term_title() if [ "$command[0]" = "fg" ] then lastjob=$(ps ft `tty` | grep "[0-9]\+[[:blank:]]\+`tty | sed 's/\/dev\///'`[[:blank:]]\+T.\? \+.:.. \\\_ " | tail -n1 | cut -c32-) - set $lastjob + set "$lastjob" fi if [ "$command[0]" = "screen" ] then -- cgit v1.2.3 From 71f1fe09120681fe8c33d866a0483ed13ea37cd1 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 1 Oct 2009 17:17:18 +0200 Subject: [Funcs] manages added files in an empty git repository --- 01_Functions.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to '01_Functions.zsh') diff --git a/01_Functions.zsh b/01_Functions.zsh index 983f5c0..de4aa2d 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -187,7 +187,11 @@ get_git_status () elif [ "$not_up_to_date" != "" ] ; then my_git_status="$git_colors[not_up_to_date]" elif [ "$(git-cat-file -t HEAD 2>/dev/null)" != "commit" ] ; then - my_git_status="$git_colors[init_in_progress]" + if [ ! -z "$(git-ls-files)" ] ; then + my_git_status="$git_colors[cached]" + else + my_git_status="$git_colors[init_in_progress]" + fi else my_git_status="$git_colors[up_to_date]" fi -- cgit v1.2.3 From e47d74524a218159ea4d04aab36a61a9cc704694 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 1 Oct 2009 17:18:00 +0200 Subject: [Funcs] when rebasing, show full head name without 'refs/' and 'heads/' part --- 01_Functions.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '01_Functions.zsh') diff --git a/01_Functions.zsh b/01_Functions.zsh index de4aa2d..9977147 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -141,7 +141,7 @@ get_git_branch () fi # Then the result - my_git_branch="[rebase $current/$last: "$(git-name-rev --name-only $(cat $REBASE_DIR/onto))".."$my_git_branch"] "$(basename $(cat $REBASE_DIR/head-name)) + my_git_branch="[rebase $current/$last: "$(git-name-rev --name-only $(cat $REBASE_DIR/onto))".."$my_git_branch"] "$(< $REBASE_DIR/head-name sed 's/^refs\///;s/^heads\///') else # No rebase in progress, put '(' ')' if needed [ ! "$checkouted_branch" ] && my_git_branch="($my_git_branch)" -- cgit v1.2.3