Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
680 B

  1. #!/bin/bash
  2. # originally via stephen ball
  3. # https://github.com/sdball/dotfiles/commit/23fca3ed514ef974b3d6c22f094b6ec30c78739d
  4. set -e
  5. (
  6. git branch |
  7. sed 's/*/ /' |
  8. while read branch; do
  9. (
  10. set +e
  11. git show-ref origin/$branch > /dev/null
  12. if [[ $? == 1 ]]; then
  13. echo -e "\e[01;31m$branch\e[00m"
  14. else
  15. incoming_count=`git rev-list $branch..origin/$branch | wc -l`
  16. outgoing_count=`git rev-list origin/$branch..$branch | wc -l`
  17. echo "$branch}$incoming_count incoming}$outgoing_count outgoing";
  18. fi
  19. )
  20. done |
  21. column -s '}' -t
  22. )