Advertisement
Guest User

Untitled

a guest
Feb 5th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. function git_ahead -a ahead behind diverged none
  2. command git rev-list --count --left-right "@{upstream}...HEAD" ^ /dev/null | awk "
  3.  
  4. /0\t0/ { print \"$none\" ? \"$none\" : \"+\"; exit 0 }
  5. /[0-9]+\t0/ { print \"$behind\" ? \"$behind\" : \"-\"; exit 0 }
  6. /0\t[0-9]+/ { print \"$ahead\" ? \"$ahead\" : \"+\"; exit 0 }
  7. // { print \"$diverged\" ? \"$diverged\" : \"±\"; exit 0 }
  8. "
  9. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement