git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Matthieu Moy <git@matthieu-moy.fr>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] push: change needlessly ambiguous example in error
Date: Wed, 14 Nov 2018 13:32:57 +0900	[thread overview]
Message-ID: <xmqqva50p9c6.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <87wopg1w2z.fsf@evledraar.gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Tue, 13 Nov 2018 22:55:32 +0100")

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

>> This "git push origin HEAD" is IMHO less common. It may confuse users.
>> Or users may learn it and be happy thanks to your message. I don't know.
>
> I was hoping for the latter. I'm slightly embarrassed to say that for
> the entire time I've been using git I've been doing:
>
>     # on branch 'topic'
>     git push origin topic:topic
>
> Where 'topic' is a tracking branch of 'origin/master' (I use
> push.default=upstream). I only recently discovered that I could push to
> 'HEAD" to do the same thing. So one ulterior motive is to make that more
> prominent.

Personally I do not think you should feel embarrassed at all.  I
didn't know it myself, and I do not recall designing such a
behaviour, so I would not be surprised if it is merely what the code
right now happens to do.  FWIW, I would have expected that a "git
push origin HEAD" when HEAD is a symref to a branch 'x' would behave
as if "git push origin x" were given, going through the usual
simple/upstream/matching etc. dance.

Do we consider the current behaviour useful?  Is it documented
already and widely known?  If the answers are yes/no, of course we
should document it, but if they are no/no, it may not be a bad idea
to deprecate it and replace it with a saner version (i.e. deref HEAD
to branch name and behave the same way as pushing that branch) over
time.



  reply	other threads:[~2018-11-14  4:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-13 20:39 [PATCH] push: change needlessly ambiguous example in error Ævar Arnfjörð Bjarmason
2018-11-13 21:37 ` Matthieu Moy
2018-11-13 21:55   ` Ævar Arnfjörð Bjarmason
2018-11-14  4:32     ` Junio C Hamano [this message]
2018-11-14  6:36       ` Matthieu Moy
2018-11-14  8:16         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqva50p9c6.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@matthieu-moy.fr \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).