bin - Personal scripts
ssh://anon@thyssentishman.com/bin
Log | Files | Refs | Feed | Contribute | README

localdiff (500B) (RAW)


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