X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/11a4aef2d1663b1b3790ad34788227f9d299e1d9..77739e9453107e3f69fa809e940885f316fb9a15:/vcsh diff --git a/vcsh b/vcsh index 2e96300..4464c85 100755 --- a/vcsh +++ b/vcsh @@ -379,6 +379,12 @@ status() { status_helper() { GIT_DIR=$VCSH_REPO_D/$VCSH_REPO_NAME.git; export GIT_DIR use + remote_tracking_branch=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2> /dev/null) && { + commits_behind=$(git log ..${remote_tracking_branch} --oneline | wc -l) + commits_ahead=$(git log ${remote_tracking_branch}.. --oneline | wc -l) + [ ${commits_behind} -ne 0 ] && echo "Behind $remote_tracking_branch by $commits_behind commits" + [ ${commits_ahead} -ne 0 ] && echo "Ahead of $remote_tracking_branch by $commits_ahead commits" + } git status --short --untracked-files='no' VCSH_COMMAND_RETURN_CODE=$? }