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
fe6ec160
Commit
fe6ec160
authored
May 31, 2015
by
Justin Hileman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[split] Move gitstatus theme to oh-my-fish/theme-gitstatus
https://github.com/oh-my-fish/theme-gitstatus
parent
41165623
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
54 deletions
+0
-54
themes/gitstatus/README.md
themes/gitstatus/README.md
+0
-14
themes/gitstatus/fish_prompt.fish
themes/gitstatus/fish_prompt.fish
+0
-40
No files found.
themes/gitstatus/README.md
deleted
100644 → 0
View file @
41165623
## GitStatus

#### Characteristics
*
Displays host information in the command prompt when connected via ssh.
*
Displays git information in the command prompt when inside a git repository.
-
Shows current branch name.
-
Shows
*
if working copy is dirty.
-
Shows # if everything is staged.
-
Shows no indicators if the working copy is clean.
themes/gitstatus/fish_prompt.fish
deleted
100644 → 0
View file @
41165623
# name: GitStatus
# Find latest version from: https://github.com/godfat/fish_prompt-gitstatus
function _git_branch_name
echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end
function _git_status_symbol
set -l git_status (git status --porcelain ^/dev/null)
if test -n "$git_status"
# Is there anyway to preserve newlines so we can reuse $git_status?
if git status --porcelain ^/dev/null | grep '^.[^ ]' >/dev/null
echo '*' # dirty
else
echo '#' # all staged
end
else
echo '' # clean
end
end
function _remote_hostname
if test -n "$SSH_CONNECTION"
echo (whoami)@(hostname)
end
end
function fish_prompt
set -l cyan (set_color cyan)
set -l normal (set_color normal)
set -l cwd (set_color $fish_color_cwd)(prompt_pwd)
set -l git_status (_git_status_symbol)(_git_branch_name)
if test -n "$git_status"
set git_status " $git_status"
end
echo -n (_remote_hostname) $cwd$cyan$git_status$normal'> '
end
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