Created
March 16, 2018 13:28
-
-
Save kenglxn/0902128222db04f388c740b828f3645d to your computer and use it in GitHub Desktop.
fish function for showing the number of commits origin/master is ahead, if any
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function diff_stat_master | |
git remote update > /dev/null | |
set __master_commits (git rev-list HEAD..origin/master --count) | |
if test $__master_commits -gt 0 | |
echo "" | |
echo "- There are $__master_commits new commits on origin/master -" | |
echo "" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install
Just copy to your fish functions directory:
Can be used with direnv to get a message when you enter the directory: https://direnv.net/
Example output
Setup
Install direnv https://direnv.net/
create a .envrc file in the repo with following content