Commit Diff


commit - 19f59598f4ef2492d961f19998f391c506016987
commit + ae4437090522e579d6c3b5dcdaa3639fdfd0818a
blob - a8e210a90ec4482290e2aa8e87ab993beb406774
blob + 342397929c2195ddfbe5b0c9df07f9f9d08398ff
--- etc/common/mykshrc
+++ etc/common/mykshrc
@@ -75,13 +75,48 @@ set -A complete_pass_1 -- show generate ls edit git rm
 alias pman='man -M /usr/local/share/doc/posix/man'
 alias papropos='apropos -M /usr/local/share/doc/posix/man'
 alias pwhatis='whatis -M /usr/local/share/doc/posix/man'
+
 gd() {
 	got di "$@" | bat -l patch
 }
+
 gl() {
 	got log -d "$@" | less
 }
 
+_gu_do() {
+	got fe -b "$1"
+	got up -b "origin/$1"
+	got rb "$1"
+}
+
+gu() {
+	if [ $# -ge 1 ]; then
+		_gu_old=$(got br)
+
+		for _gu_br in "$@"; do
+			_gu_do "${_gu_br}"
+		done
+
+		got up -b "${_gu_old}"
+	else
+		_gu_do "$(got br)"
+	fi
+	unset _gu_old _gu_br
+}
+
+gua() {
+	_gu_old=$(got br)
+
+	got br -l | cut -d: -f1 | sed 's/^[\* ] //' | grep -v '/' | while read -r _gu_br; do
+		_gu_do "${_gu_br}"
+	done
+
+	got up -b "${_gu_old}"
+
+	unset _gu_br _gu_old
+}
+
 if [ "$TERM" = "xterm" ]; then
 	printf '\e[4?h'
 fi