From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
git@vger.kernel.org, Jeff King <peff@peff.net>
Subject: Re: [PATCH] push: error out when the "upstream" semantics does not make sense
Date: Fri, 06 Apr 2012 09:16:02 +0200 [thread overview]
Message-ID: <vpqiphd49fx.fsf@bauges.imag.fr> (raw)
In-Reply-To: <7vy5q95354.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Thu, 05 Apr 2012 13:34:31 -0700")
Junio C Hamano <gitster@pobox.com> writes:
>> "To push the current branch to this remote, run:
>>
>> git push <remote> <branch>
>>
>> "
>
> I am afraid that the above advice is a lot worse than leaving it unsaid.
>
> We are in no position to assume that the user wanted the "current"
> semantics when we issue this message. Otherwise, we would be better off
> switching the default semantics to "current", not "upstream". But the
> working assumption in this series is that "upstream" is an improvement
> over "current", no?
I'm not sure. I do support "upstream", but I also think that in many
(most?) cases, the user will want to set "upstream" to point to the
branch with the same name. If there is any confusion between "current"
and "upstream", then avoiding situations where they do something
different is not stupid. This is already what we do when there is no
upstream configured at all:
$ git push origin
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
OTOH, if the user sees this message, he already has several remotes
configured, and we can probably expect him not to be a total newbie.
Then suggesting
"git push --set-upstream %s %s:<remote-branch-name>", remote->name, branch->name
would make sense.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
prev parent reply other threads:[~2012-04-06 7:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-04 23:26 What's cooking in git.git (Apr 2012, #02; Wed, 4) Junio C Hamano
2012-04-05 12:47 ` Jeff King
2012-04-05 16:00 ` [PATCH] push: error out when the "upstream" semantics does not make sense Junio C Hamano
2012-04-05 18:43 ` Jonathan Nieder
2012-04-05 19:48 ` Junio C Hamano
2012-04-05 19:58 ` Jonathan Nieder
2012-04-05 20:01 ` Junio C Hamano
2012-04-05 20:23 ` Jonathan Nieder
2012-04-05 20:24 ` Matthieu Moy
2012-04-05 20:34 ` Junio C Hamano
2012-04-06 7:16 ` Matthieu Moy [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vpqiphd49fx.fsf@bauges.imag.fr \
--to=matthieu.moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=peff@peff.net \
/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.
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 NNTP newsgroup(s).