Both paths work. Done.
I added branch reporting to the git-recursive status output. Each repository now shows its currently checked-out branch between the path and the status, so repos switched to a non-default branch stand out at a glance (e.g. utilities on dboreham/print-repo-branch above).
Changes in git-recursive/git-recursive:
- report_repo: determines the current branch via symbolic-ref --short HEAD, falling back to detached@<short-commit> for a detached HEAD, and prints it as a new middle column.
- usage: documents the branch column.
Along the way I caught a set -e bug: the standalone branch=$(…) assignment would have aborted the script on a detached HEAD (where symbolic-ref exits non-zero), so I guarded both substitutions with || branch="" / || commit="". Verified against a normal repo, a non-default branch, and a detached HEAD.