From 89e4dce48f5a8dee3a636701d307e5033e8fe518 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 13 Mar 2008 00:23:32 +0100 Subject: Always truncates the path and git-branch to let a minimal free space for command prompt in the same line. Almost 40 characters (50% of a 80-wide terminal) will always be free for the command prompt : - the path will then be shrinked inside the remaining space available (letting at least 10 characters for the git-branch), until it reaches 10 characters min. - the git-branch (or the named-git-rev, or the git-commit-id) will then be shrinked until 10 characters min., always displaying, if available, the parent-level (~...), and, always, the first letters of the git-branch/named-rev/commit-id. --- 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 18cf1c6..1b53f40 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -72,7 +72,7 @@ get_git_branch () # If neither on a named commit-ish, show abbreviated commit-id [ "$my_git_branch" == "" ] &&\ - my_git_branch="($(git-show --pretty=format:%h 2>&- | head -n1)...)" + my_git_branch="($(git-show --pretty=format:%H 2>&- | head -n1))" fi echo $my_git_branch -- cgit v1.2.3