X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/c3c88c981d7e4d5cafcd69137d76de64b0236ace..35d1c19fd0099ffa87098e1bf7433f83a6fc2d18:/vcsh diff --git a/vcsh b/vcsh index 18cd9e5..9d399d4 100755 --- a/vcsh +++ b/vcsh @@ -314,6 +314,12 @@ status() { echo "$VCSH_REPO_NAME:" 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=$? echo