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

Re: [PATCH] push: error out when the "upstream" semantics does not make sense

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 5, 2012, 20:34 UTC
Message-ID
<7vy5q95354.fsf@alter.siamese.dyndns.org>
In-Reply-To
<vpqsjgi53mh.fsf@bauges.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 10 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>>  		die(_("You are pushing to remote '%s', which is not the "
>> -		      "upstream of your\ncurrent branch '%s'.\n"),
>> +		      "upstream of your\ncurrent branch '%s',\n"
>> +		      "without telling me to push which local branch to\n"
>> +		      " update which remote branch with."),
>
> Sounds overly complex sentence to me. "without telling me what to push"
> sounded good enough without being long, so I prefered it.
You are right; it is overly complex.
After sending the updated patch, I rewrote it again to:
    You are pushing to remote '%s', which is not the upstream of
    your current branch '%s', without telling me what to push
    to update which remote branch.

The point of Jonathan's 'refspec' and this attempt to rephrase it without using a jargon is to make sure that the user realizes that both ends can be specified.

Show 8 quoted lines
> I like accompanying these messages with the way out for the user, so
> perhaps we can add stg like
>
> "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?

Previous: Matthieu MoyNext: Matthieu Moy
Message 10 of 11 in “What's cooking in git.git (Apr 2012, #02; Wed, 4)”
  1. Junio C HamanoApr 4, 2012
  2. Jeff KingApr 5, 2012
  3. push: error out when the "upstream" semantics does not make senseJunio C Hamano, Apr 5, 2012
  4. Jonathan NiederApr 5, 2012
  5. Junio C HamanoApr 5, 2012
  6. Jonathan NiederApr 5, 2012
  7. Junio C HamanoApr 5, 2012
  8. Jonathan NiederApr 5, 2012
  9. Matthieu MoyApr 5, 2012
  10. Junio C HamanoApr 5, 2012
  11. Matthieu MoyApr 6, 2012

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.