This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "$(basename $(pwd))..." ; git branch -a 2>/dev/null | cut -c 3- | perl -p -e 's#remotes/origin/##' | awk '{ print $1; }' | grep -v "remotes" | sort | uniq -c | awk '{ if($1=="2") { print $2; } ; }' | while read b ; do { [ ! -z "$(git cherry remotes/origin/$b $b 2>/dev/null)" ] && echo "$(basename $(pwd)): branch ${b} has unpushed commits" ; } ; done ; git branch -a 2>/dev/null | cut -c 3- | perl -p -e 's#remotes/origin/##' | awk '{ print $1; }' | grep -v "remotes" | sort | uniq -c | awk '{ if($1=="1") { print $2; } ; }' | while read b ; do { [ -z "$(git branch -a | cut -c 3- | awk -v branch="remotes/origin/${b}" '{ if($1==branch) { print $1; } ; }')" ] && echo "$(basename $(pwd)): branch ${b} does not exist on remote origin" ; } ; done ; [ ! -z "$(git status --porcelain -uno 2>/dev/null)" ] && echo "$(basename $(pwd)): working directory is dirty" ; [ ! -z "$(git status --porcelain -uall 2>/dev/null | perl -n -e 'm/^\?\?/ && print')" ] && echo "$(basename $(pwd)): working directory contains untracked file |