summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-02-16 17:17:09 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-02-16 17:17:09 -0800
commit79a1e6b432d7d7ffaf2079d4cf895583502ca923 (patch)
treefab1929683a970dcd5e529a5627ab46d70eddaec /contrib
parentBuild in checkout (diff)
downloadtgif-79a1e6b432d7d7ffaf2079d4cf895583502ca923.tar.xz
checkout: notice when the switched branch is behind or forked
When you are switching to a branch that is marked to merge from somewhere else, e.g. when you have: [branch "next"] remote = upstream merge = refs/heads/next [remote "upstream"] url = ... fetch = refs/heads/*:refs/remotes/linus/* and you say "git checkout next", the branch you checked out may be behind, and you may want to update from the upstream before continuing to work. This patch makes the command to check the upstream (in this example, "refs/remotes/linus/next") and our branch "next", and: (1) if they match, nothing happens; (2) if you are ahead (i.e. the upstream is a strict ancestor of you), one line message tells you so; (3) otherwise, you are either behind or you and the upstream have forked. One line message will tell you which and then you will see a "log --pretty=oneline --left-right". We could enhance this with an option that tells the command to check if there is no local change, and automatically fast forward when you are truly behind. But I ripped out that change because I was unsure what the right way should be to allow users to control it (issues include that checkout should not become automatically interactive). Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
0 files changed, 0 insertions, 0 deletions