Thread (6 messages) 6 messages, 4 authors, 2019-07-31

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

From: Jeff King <hidden>
Date: 2019-07-31 05:58:35

On Wed, Jul 10, 2019 at 11:39:37PM +0000, brian m. carlson wrote:
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help