Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
dbb69453
Commit
dbb69453
authored
Apr 07, 2014
by
Anton Beloglazov
Committed by
Bruno Pinto
Apr 16, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
beloglazov theme: call _git_branch_name only once - performance
parent
79d6869a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
themes/beloglazov/fish_prompt.fish
themes/beloglazov/fish_prompt.fish
+5
-4
No files found.
themes/beloglazov/fish_prompt.fish
View file @
dbb69453
...
...
@@ -8,8 +8,8 @@ function _is_git_dirty
echo (command git status -s --ignore-submodules=dirty ^/dev/null)
end
function _git_ahead_count
echo (command git log origin/
(_git_branch_name)
..HEAD ^/dev/null | \
function _git_ahead_count
-a branch_name
echo (command git log origin/
$branch_name
..HEAD ^/dev/null | \
grep '^commit' | wc -l | tr -d ' ')
end
...
...
@@ -38,9 +38,10 @@ function fish_prompt
set -l cwd $cyan(basename (prompt_pwd))$normal
if [ (_git_branch_name) ]
set -l git_branch $brightred(_git_branch_name)$normal
set -l git_branch_name (_git_branch_name)
set -l git_branch $brightred$git_branch_name$normal
set git_info "$blue ($git_branch$blue)$normal"
set -l git_ahead_count (_git_ahead_count)
set -l git_ahead_count (_git_ahead_count
$git_branch_name
)
if [ $git_ahead_count != 0 ]
set -l ahead_count "$green+$git_ahead_count$normal"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment