From 9767a6d2cecb5ad82d4c82b196c0f201c985e1c1 Mon Sep 17 00:00:00 2001 From: Niam Patel Date: Tue, 9 Jul 2013 21:50:56 +0100 Subject: [PATCH] replaced references to `git` with `command git`, to make the shell faster for git wrapper users --- themes/agnoster/fish_prompt.fish | 10 +++++----- themes/cor/fish_right_prompt.fish | 4 ++-- themes/idan/fish_prompt.fish | 4 ++-- themes/krisleech/fish_prompt.fish | 4 ++-- themes/l/fish_prompt.fish | 6 +++--- themes/numist/fish_prompt.fish | 8 ++++---- themes/robbyrussell/fish_prompt.fish | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/themes/agnoster/fish_prompt.fish b/themes/agnoster/fish_prompt.fish index a0299c5..190f929 100644 --- a/themes/agnoster/fish_prompt.fish +++ b/themes/agnoster/fish_prompt.fish @@ -26,7 +26,7 @@ set -g __fish_git_prompt_char_cleanstate '' function parse_git_dirty set -l submodule_syntax set submodule_syntax "--ignore-submodules=dirty" - set git_dirty (git status -s $submodule_syntax 2> /dev/null) + set git_dirty (command git status -s $submodule_syntax 2> /dev/null) if [ -n "$git_dirty" ] if [ $__fish_git_prompt_showdirtystate = "yes" ] echo -n "$__fish_git_prompt_char_dirtystate" @@ -105,12 +105,12 @@ end function prompt_git -d "Display the actual git state" set -l ref set -l dirty - if git rev-parse --is-inside-work-tree >/dev/null 2>&1 + if command git rev-parse --is-inside-work-tree >/dev/null 2>&1 set dirty (parse_git_dirty) - set ref (git symbolic-ref HEAD 2> /dev/null) - set ref (git symbolic-ref HEAD 2> /dev/null) + set ref (command git symbolic-ref HEAD 2> /dev/null) + set ref (command git symbolic-ref HEAD 2> /dev/null) if [ $status -gt 0 ] - set -l branch (git show-ref --head -s --abbrev |head -n1 2> /dev/null) + set -l branch (command git show-ref --head -s --abbrev |head -n1 2> /dev/null) set ref "➦ $branch " end set -l branch (echo $ref | sed 's-refs/heads/-⭠ -') diff --git a/themes/cor/fish_right_prompt.fish b/themes/cor/fish_right_prompt.fish index 88ab5c8..d6ffb42 100644 --- a/themes/cor/fish_right_prompt.fish +++ b/themes/cor/fish_right_prompt.fish @@ -1,11 +1,11 @@ # Display git branch and dirty bit and current time on the right function _git_branch_name - echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') + echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') end function _is_git_dirty - echo (git status -s --ignore-submodules=dirty ^/dev/null) + echo (command git status -s --ignore-submodules=dirty ^/dev/null) end function fish_right_prompt diff --git a/themes/idan/fish_prompt.fish b/themes/idan/fish_prompt.fish index f6d2fd6..00ec450 100644 --- a/themes/idan/fish_prompt.fish +++ b/themes/idan/fish_prompt.fish @@ -4,11 +4,11 @@ # * Git branch and dirty state (if inside a git repo) function _git_branch_name - echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') + echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') end function _is_git_dirty - echo (git status -s --ignore-submodules=dirty ^/dev/null) + echo (command git status -s --ignore-submodules=dirty ^/dev/null) end function fish_prompt diff --git a/themes/krisleech/fish_prompt.fish b/themes/krisleech/fish_prompt.fish index 7ba03ca..2de7a7f 100644 --- a/themes/krisleech/fish_prompt.fish +++ b/themes/krisleech/fish_prompt.fish @@ -1,9 +1,9 @@ function _git_branch_name - echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') + echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') end function _is_git_dirty - echo (git status -s --ignore-submodules=dirty ^/dev/null) + echo (command git status -s --ignore-submodules=dirty ^/dev/null) end function fish_prompt diff --git a/themes/l/fish_prompt.fish b/themes/l/fish_prompt.fish index 43fc36c..db5f1c6 100644 --- a/themes/l/fish_prompt.fish +++ b/themes/l/fish_prompt.fish @@ -1,9 +1,9 @@ function _git_branch_name - echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') + echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') end function _is_git_dirty - echo (git status -s --ignore-submodules=dirty ^/dev/null) + echo (command git status -s --ignore-submodules=dirty ^/dev/null) end function fish_prompt @@ -25,4 +25,4 @@ function fish_prompt end echo -n -s $cwd $git_info $normal ' ' $arrow ' ' -end \ No newline at end of file +end diff --git a/themes/numist/fish_prompt.fish b/themes/numist/fish_prompt.fish index 789f85e..aa268ac 100644 --- a/themes/numist/fish_prompt.fish +++ b/themes/numist/fish_prompt.fish @@ -50,17 +50,17 @@ function fish_prompt # Git stuff set -l git_info - if [ (git rev-parse --is-inside-work-tree ^/dev/null) ] + if [ (command git rev-parse --is-inside-work-tree ^/dev/null) ] # Get the current branch name/commit - set -l git_branch_name (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') + set -l git_branch_name (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') if [ -z $git_branch_name ] - set git_branch_name (git show-ref --head -s --abbrev | head -n1 2> /dev/null) + set git_branch_name (command git show-ref --head -s --abbrev | head -n1 2> /dev/null) end # Unconditional git component set git_info "$normal""on $white$git_branch_name" - if [ (git status -s --ignore-submodules=dirty | wc -l) -gt 0 ] + if [ (command git status -s --ignore-submodules=dirty | wc -l) -gt 0 ] set git_info "$git_info$yellow*" end diff --git a/themes/robbyrussell/fish_prompt.fish b/themes/robbyrussell/fish_prompt.fish index e5364db..0c659a0 100644 --- a/themes/robbyrussell/fish_prompt.fish +++ b/themes/robbyrussell/fish_prompt.fish @@ -1,9 +1,9 @@ function _git_branch_name - echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') + echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') end function _is_git_dirty - echo (git status -s --ignore-submodules=dirty ^/dev/null) + echo (command git status -s --ignore-submodules=dirty ^/dev/null) end function fish_prompt