]> git.ipfire.org Git - thirdparty/git.git/commit - sha1-name.c
sha1_name: implement @{push} shorthand
authorJeff King <peff@peff.net>
Thu, 21 May 2015 04:45:47 +0000 (00:45 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 22 May 2015 16:33:08 +0000 (09:33 -0700)
commitadfe5d04345631299f9a4518d56c6dd3d47eb0b3
tree45858e99c4038ea5e029ab917705b819885be081
parent48c58471c2d4d7293272448a18801cd27555f6b5
sha1_name: implement @{push} shorthand

In a triangular workflow, each branch may have two distinct
points of interest: the @{upstream} that you normally pull
from, and the destination that you normally push to. There
isn't a shorthand for the latter, but it's useful to have.

For instance, you may want to know which commits you haven't
pushed yet:

  git log @{push}..

Or as a more complicated example, imagine that you normally
pull changes from origin/master (which you set as your
@{upstream}), and push changes to your own personal fork
(e.g., as myfork/topic). You may push to your fork from
multiple machines, requiring you to integrate the changes
from the push destination, rather than upstream. With this
patch, you can just do:

  git rebase @{push}

rather than typing out the full name.

The heavy lifting is all done by branch_get_push; here we
just wire it up to the "@{push}" syntax.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/revisions.txt
sha1_name.c
t/t1514-rev-parse-push.sh [new file with mode: 0755]