diff --git a/bin/git-info b/bin/git-info index bfc3934..88d6a2d 100755 --- a/bin/git-info +++ b/bin/git-info @@ -8,6 +8,11 @@ most_recent_commit() { git log --max-count=1 --pretty=short } +submodules() { + # short sha1 + git submodule status | sed 's/\([^abcdef0-9]\{,2\}\)\([abcdef0-9]\{7\}\)\([abcdef0-9]\{33\}\)\(.*\)/\1\2\4/' +} + local_branches() { git branch } @@ -35,6 +40,12 @@ echon "$(remote_branches)" echon "## Local Branches:" echon "$(local_branches)" +SUBMODULES_LOG=$(submodules) +if [ ! -z "$SUBMODULES_LOG" ]; then + echon "## Submodule(s):" + echon "$SUBMODULES_LOG" +fi + echon "## Most Recent Commit:" echon "$(most_recent_commit)" echon "Type 'git log' for more commits, or 'git show ' for full commit details."