mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
git-info: add info about submodules
This commit is contained in:
parent
aaf9ef343b
commit
87cff6d5cb
11
bin/git-info
11
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 <commit id>' for full commit details."
|
||||
|
|
|
|||
Loading…
Reference in a new issue