git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 6/6] sha1_name: implement @{push} shorthand

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 31, 2015, 21:41 UTC
Message-ID
<CAPig+cR9U9Tm1Lbk_wQpfvY7okEKvYgMvNRzT1ci2u9ALr0HpQ@mail.gmail.com>
In-Reply-To
<20150331173834.GF18912@peff.net>
On Tue, Mar 31, 2015 at 1:38 PM, Jeff King <peff@peff.net> wrote:
Show 14 quoted lines
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt
> index 0796118..5d9df25 100644
> --- a/Documentation/revisions.txt
> +++ b/Documentation/revisions.txt
> @@ -98,6 +98,31 @@ some output processing may assume ref names in UTF-8.
>    `branch.<name>.merge`).  A missing branchname defaults to the
>    current one.
>
> +'<branchname>@\{push\}', e.g. 'master@\{push\}', '@\{push\}'::
> +  The suffix `@{push}` reports the branch "where we would push to" if
> +  `git push` were run while `branchname` was checked out (or the current
> +  `HEAD` is no branchname is specified). Since our push destination is
s/is no/if no/
Show 24 quoted lines
> +  in a remote repository, of course, we report the local tracking branch
> +  that corresponds to that branch (i.e., something in `refs/remotes/`).
> ++
> +Here's an example to make it more clear:
> ++
> +------------------------------
> +$ git config push.default current
> +$ git config remote.pushdefault myfork
> +$ git checkout -b mybranch origin/master
> +
> +$ git rev-parse --symbolic-full-name @{upstream}
> +refs/remotes/origin/master
> +
> +$ git rev-parse --symbolic-full-name @{push}
> +refs/remotes/myfork/mybranch
> +------------------------------
> ++
> +Note in the example that we set up a triangular workflow, where we pull
> +from one location and push to another. In a non-triangular workflow,
> +`@{push}` is the same as `@{upstream}`, and there is no need for it.
> +
>  '<rev>{caret}', e.g. 'HEAD{caret}, v1.5.1{caret}0'::
>    A suffix '{caret}' to a revision parameter means the first parent of
>    that commit object.  '{caret}<n>' means the <n>th parent (i.e.
Previous: Junio C HamanoNext: Jeff King
Message 17 of 18 in “implement @{push} shorthand”
  1. 0/6 implement @{push} shorthandJeff King, Mar 31, 2015
  2. 1/6 remote.c: drop default_remote_name variableJeff King, Mar 31, 2015
  3. Junio C HamanoMar 31, 2015
  4. Jeff KingMar 31, 2015
  5. 2/6 remote.c: drop "remote" pointer from "struct branch"Jeff King, Mar 31, 2015
  6. Junio C HamanoMar 31, 2015
  7. Jeff KingMar 31, 2015
  8. Junio C HamanoMar 31, 2015
  9. 3/6 remote.c: hoist branch.*.remote lookup out of remote_get_1Jeff King, Mar 31, 2015
  10. 4/6 remote.c: provide per-branch pushremote nameJeff King, Mar 31, 2015
  11. Junio C HamanoMar 31, 2015
  12. 5/6 sha1_name: refactor upstream_markJeff King, Mar 31, 2015
  13. 6/6 sha1_name: implement @{push} shorthandJeff King, Mar 31, 2015
  14. Junio C HamanoMar 31, 2015
  15. Jeff KingMar 31, 2015
  16. Junio C HamanoMar 31, 2015
  17. Eric SunshineMar 31, 2015
  18. Jeff KingMar 31, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.