Add better tag support in the git branch segment.

pull/58/head
Justin Hileman 8 years ago
parent b2f097c91c
commit 4669e3dad6

@ -52,11 +52,15 @@
function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish)'
set -l ref (command git symbolic-ref HEAD ^/dev/null)
if [ $status -gt 0 ]
set -l branch (command git show-ref --head -s --abbrev | head -n1 ^/dev/null)
set ref "$__bobthefish_detached_glyph $branch"
end
echo $ref | sed "s#refs/heads/#$__bobthefish_branch_glyph #"
and echo $ref | sed "s#refs/heads/#$__bobthefish_branch_glyph #"
and return
set -l tag (command git describe --tags --exact-match ^/dev/null)
and echo "$__bobthefish_tag_glyph $tag"
and return
set -l branch (command git show-ref --head -s --abbrev | head -n1 ^/dev/null)
echo "$__bobthefish_detached_glyph $branch"
end
function __bobthefish_hg_branch -S -d 'Get the current hg branch'

Loading…
Cancel
Save