This commit is contained in:
Bernardo Heynemann 2017-01-21 21:18:30 +00:00 committed by GitHub
commit aebf06c197

View File

@ -20,6 +20,7 @@
# set -g theme_display_git no # set -g theme_display_git no
# set -g theme_display_git_untracked no # set -g theme_display_git_untracked no
# set -g theme_display_git_ahead_verbose yes # set -g theme_display_git_ahead_verbose yes
# set -g theme_display_git_latest_tag no
# set -g theme_git_worktree_support yes # set -g theme_git_worktree_support yes
# set -g theme_display_vagrant yes # set -g theme_display_vagrant yes
# set -g theme_display_docker_machine no # set -g theme_display_docker_machine no
@ -52,16 +53,23 @@
# end # end
function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish)' function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish)'
if [ "$theme_display_git_latest_tag" = 'yes' ]
set -l latest_tag_value (command git describe --abbrev=0 --tags 2> /dev/null)
if [ "$latest_tag_value" != '' ]
set latest_tag " $__bobthefish_latest_tag_glyph$latest_tag_value"
end
end
set -l ref (command git symbolic-ref HEAD ^/dev/null) set -l ref (command git symbolic-ref HEAD ^/dev/null)
and echo $ref | sed "s#refs/heads/#$__bobthefish_branch_glyph #" and echo "$ref$latest_tag" | sed "s#refs/heads/#$__bobthefish_branch_glyph #"
and return and return
set -l tag (command git describe --tags --exact-match ^/dev/null) set -l tag (command git describe --tags --exact-match ^/dev/null)
and echo "$__bobthefish_tag_glyph $tag" and echo "$__bobthefish_tag_glyph $tag$latest_tag"
and return and return
set -l branch (command git show-ref --head -s --abbrev | head -n1 ^/dev/null) set -l branch (command git show-ref --head -s --abbrev | head -n1 ^/dev/null)
echo "$__bobthefish_detached_glyph $branch" echo "$__bobthefish_detached_glyph $branch$latest_tag"
end end
function __bobthefish_hg_branch -S -d 'Get the current hg branch' function __bobthefish_hg_branch -S -d 'Get the current hg branch'
@ -791,6 +799,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome'
# Additional glyphs # Additional glyphs
set -l __bobthefish_detached_glyph \u27A6 set -l __bobthefish_detached_glyph \u27A6
set -l __bobthefish_tag_glyph \u2302 set -l __bobthefish_tag_glyph \u2302
set -l __bobthefish_latest_tag_glyph \u205D
set -l __bobthefish_nonzero_exit_glyph '! ' set -l __bobthefish_nonzero_exit_glyph '! '
set -l __bobthefish_superuser_glyph '$ ' set -l __bobthefish_superuser_glyph '$ '
set -l __bobthefish_bg_job_glyph '% ' set -l __bobthefish_bg_job_glyph '% '