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?ds=sidebyside;hp=--cc Merge branch 'feature/status_against_remote_tracking' Conflicts: vcsh --- e4bc54441966a1c4225d666a1de5e6df47410336 diff --cc vcsh index 58ecb7f,9d399d4..246a7da --- a/vcsh +++ b/vcsh @@@ -376,13 -327,6 +376,19 @@@ status() fi } +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=$? +} + upgrade() { hook pre-upgrade # fake-bare repositories are not bare, actually. Set this to false