From: Richard Hartmann Date: Sat, 25 Oct 2014 05:57:56 +0000 (+0200) Subject: Merge branch 'feature/status_against_remote_tracking' X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/e4bc54441966a1c4225d666a1de5e6df47410336?hp=712cef9c4d816ff5960945f46f3a0a03e8921325 Merge branch 'feature/status_against_remote_tracking' Conflicts: vcsh --- diff --git a/vcsh b/vcsh index 58ecb7f..246a7da 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=$? }