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

Re: `@` alias for `HEAD` not working in `git push -u origin @`

From
Jeff King <peff@peff.net>
Date
Jul 31, 2019, 05:58 UTC
Message-ID
<20190731055832.GA18039@sigill.intra.peff.net>
In-Reply-To
<20190710233937.GG9224@genre.crustytoothpaste.net>
On Wed, Jul 10, 2019 at 11:39:37PM +0000, brian m. carlson wrote:
Show 10 quoted lines
> This is a bug. If the destination side of a refspec is omitted, and the
> source side resolves to a ref starting with "refs/heads/" or
> "refs/tags/" (which I expect it does here), then that ref is used as the
> destination.
> 
> I submitted a patch at [0], but it was decided not to pick it up. If
> Junio and the list decide that it's wanted, I'm happy to resend or
> revise and resend.
> 
> [0] https://public-inbox.org/git/20180729192803.1047050-1-sandals@crustytoothpaste.net/

I see I was cc'd on that original, but I don't remember ever reading it. It seems like a sane enough idea to me.

Although I did notice that you mentioned there:
> I probably type "git push upstream HEAD" from five to thirty times a
> day
I find I do that rarely, because I have:
  [push]
  default = current
and in a triangular workflow, I have:
  [remote]
  pushDefault = upstream
So "git push" without arguments typically does the same thing for me.

Not an argument against your patch, but just something you might find useful.

-Peff
Previous: Johannes SchindelinNext: Junio C Hamano
Message 6 of 7 in “`@` alias for `HEAD` not working in `git push -u origin @`”
  1. Mark FlorianJul 10, 2019
  2. brian m. carlsonJul 10, 2019
  3. Johannes SchindelinJul 11, 2019
  4. brian m. carlsonJul 11, 2019
  5. Johannes SchindelinJul 12, 2019
  6. Jeff KingJul 31, 2019
  7. Junio C HamanoJul 31, 2019

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.