diff options
author | Hugues Hiegel <hugues@hiegel.fr> | 2008-03-14 21:39:40 +0100 |
---|---|---|
committer | Hugues Hiegel <hugues@hiegel.fr> | 2008-03-14 21:39:40 +0100 |
commit | 9088c1576c25eb8ab0e8ad466c1353bcfe4fbd39 (patch) | |
tree | 715cf4a4a5080f542d91e4c134f44710ea124f6f | |
parent | a9241efcaba7f970f094f8e2cdb4cab2f0aef408 (diff) |
Better analysis of git-named-revs,
with truncation of starting "tags/" or "remotes/" from the result.
-rw-r--r-- | 01_Functions.zsh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/01_Functions.zsh b/01_Functions.zsh index 1b53f40..78c024d 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -68,7 +68,7 @@ get_git_branch () then # If not on a working GIT branch, get the named current commit-ish inside parenthesis [ "$my_git_branch" == "(no branch)" ] &&\ - my_git_branch="$(git-show --pretty=format:%H 2>&- | head -n1 | git-name-rev --stdin 2>&- | awk '{ print $2 }')" + my_git_branch="($(git-name-rev HEAD 2>&- | awk '{ print $2 }' | sed 's,^tags/,,;s,^remotes/,,'))" # If neither on a named commit-ish, show abbreviated commit-id [ "$my_git_branch" == "" ] &&\ |