#!/bin/sh # Show if repositories have uncommitted or unpushed changes. { printf 'REPOSITORY#COMMITTED#SYNCED\n' find "${HOME}" -path "${HOME}/.local/backups" -prune \ -o -type d -name '.got' -print | while read -r path do cd "$path" || continue; branch=$(got branch) set -- $(got branch -l | awk "/${branch}:/ {print \$NF}") [ "$1" == "$2" ] && sync="yes" || sync="no" [ -z "$(got diff)" ] && comm="yes" || comm="no" printf '%s#%s#%s\n' "${path%/*}" "$comm" "$sync" done } | column -s'#' -t