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
99abb82f
Commit
99abb82f
authored
Apr 04, 2014
by
Felipe Rodrigues de Almeida
Committed by
Bruno Pinto
Apr 16, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Took the extra 0 out
parent
4ab4cb5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
themes/integral/fish_prompt.fish
themes/integral/fish_prompt.fish
+12
-6
No files found.
themes/integral/fish_prompt.fish
View file @
99abb82f
...
...
@@ -3,10 +3,14 @@ function _git_branch_name
echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end
function _git_vs_upstream
set count (command git rev-list --count --left-right "origin/$argv"...HEAD ^/dev/null)
function _upstream_count
echo (command git rev-list --count --left-right origin/(_git_branch_name)...HEAD ^/dev/null)
end
function _git_up_info
if [ (_upstream_count) ]
set -l count (_upstream_count)
if count
switch $count
case "" # no upstream
echo ''
...
...
@@ -17,7 +21,9 @@ function _git_vs_upstream
case "??0" # behind upstream
echo 'u-'(echo $count | cut -f1)
case '???' # diverged from upstream
echo 'u+'(echo $count | cut -f2)'-'(echo $count | cut -f1)
echo $count 'u+'(echo $count | cut -f2)'-'(echo $count | cut -f1)
case '*'
echo ''
end
end
end
...
...
@@ -37,11 +43,11 @@ function fish_prompt
if [ (_git_branch_name) ]
set -l git_branch (_git_branch_name)
set -l git_vs_upstream (_git_
vs_upstream $git_branch
)
set -l git_vs_upstream (_git_
up_info
)
if [ (_is_git_dirty) ]
set git_info $yellow '('$git_branch "±" "$git_vs_upstream"')' $normal
else if [ (_
git_vs_upstream $git_branch
) ]
else if [ (_
upstream_count
) ]
set git_info $yellow '('$git_branch "$git_vs_upstream"')' $normal
else
set git_info $green '('$git_branch')' $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