PageRenderTime 22ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/mg.sh

https://gitlab.com/cdb/scripts
Shell | 29 lines | 22 code | 1 blank | 6 comment | 0 complexity | 5b62ded3ac08b9e151faa56e6f115bac MD5 | raw file
  1. #!/usr/bin/env sh
  2. # Requirements:
  3. # - parallel: GNU parallel
  4. # - git: Git
  5. # - rg: RipGrep from BurntSushi, needed for PCRE regexes
  6. case "$1" in
  7. st)
  8. parallel -k -a .repos --tag git -C {} status -s
  9. ;;
  10. pull)
  11. parallel -k -a .repos --tag git -C {} pull --ff-only --rebase=false
  12. ;;
  13. current-branch)
  14. parallel -k -a .repos --tag git -C {} rev-parse --abbrev-ref HEAD
  15. ;;
  16. outdated)
  17. # Show where the checked-out branch is out of date with the remote
  18. parallel -k -a .repos --tag "git -C {} status | rg -P \"Your branch is (?"'!'"up to date)\""
  19. ;;
  20. help|-h|--help)
  21. echo "Usage: $0 st|pull"
  22. exit 1
  23. ;;
  24. git)
  25. shift
  26. parallel -k -a .repos --tag git -C {} "$@"
  27. ;;
  28. esac