git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Julia Evans" <julia@jvns.ca>
Cc: "Julia Evans" <gitgitgadget@gmail.com>,
	 git@vger.kernel.org,  "D. Ben Knoble" <ben.knoble@gmail.com>,
	 "Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com>
Subject: Re: [PATCH v3 4/4] doc: git-push: clarify "what to push"
Date: Thu, 25 Sep 2025 14:15:46 -0700	[thread overview]
Message-ID: <xmqqzfaidyil.fsf@gitster.g> (raw)
In-Reply-To: <2365a7b9-3d22-4406-876d-65822822655f@app.fastmail.com> (Julia Evans's message of "Thu, 25 Sep 2025 16:50:32 -0400")

"Julia Evans" <julia@jvns.ca> writes:

>>> +As a safety measure, `git push` may fail if you haven't set an upstream
>>> +for the current branch, depending on what `push.default` is set to.
>>> +See the UPSTREAM BRANCHES section below for more on how to set and
>>> +use upstreams.
>>
>> This feels a bit out of place, as the safety measure, as I
>> understand it, is only relevant in 3. and only when push.default is
>> set to "simple".  If we are referring the user to the configuration
>> section, then it may be a better place to say that the "simple"
>> setting requires you to integrate with the branch with the same name.
>
> That makes sense. My goal here is really to communicate that you may need
> to set an upstream for `git push` to work, since it hasn't been mentioned yet
> that the upstream branch might be involved in deciding what remote branch
> to push to, and it comes up pretty often when using the command.

Actually, I think it is a mistake to tell people to use unadorned
"git push" all the time.  Have them say "git push origin mytopic",
get them feel sick of doing so all the time, and then tell them they
do not have to if they set an upstream for the current branch.  IOW,
"sometimes you need to" is the source of the confusion that comes
from giving them too much DWIMmery.  You'd by default need to tell
Git, because you know more about your project than Git does, until
you tell Git once, after which Git knows what to do.

> Perhaps this instead:
>
> "Depending on the value of `push.default`, git push` may fail if the current
> branch doesn't have a configured upstream branch.
> See the UPSTREAM BRANCHES section below for more on how to set and
> use upstreams."

So, rather, something like this

    "git push" needs to know what branch to push to update what
    branch of which repository.  It is done by giving command line
    arguments and/or setting configuration variables to the command.
    See UPSTREAM BRANCHES section for more information.

would be more in line with a preferrable mindset users would have to
successfully use "git push", I think.

  reply	other threads:[~2025-09-25 21:15 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-26 20:40 [PATCH 0/4] doc: git-push: clarify DESCRIPTION section & refspec definition Julia Evans via GitGitGadget
2025-08-26 20:40 ` [PATCH 1/4] doc: git-push: update intro Julia Evans via GitGitGadget
2025-08-28 13:53   ` D. Ben Knoble
2025-08-28 16:18     ` Junio C Hamano
2025-08-29  7:20       ` Kristoffer Haugsbakk
2025-08-28 17:47     ` Julia Evans
2025-08-28 19:39       ` D. Ben Knoble
2025-08-26 20:40 ` [PATCH 2/4] doc: git-push: clarify "where to push" Julia Evans via GitGitGadget
2025-08-27  0:05   ` Junio C Hamano
2025-08-26 20:40 ` [PATCH 3/4] doc: git-push: clarify "what " Julia Evans via GitGitGadget
2025-08-26 23:57   ` Junio C Hamano
2025-08-27 13:52     ` Julia Evans
2025-08-28 14:25   ` D. Ben Knoble
2025-08-26 20:40 ` [PATCH 4/4] doc: git-push: rewrite refspec specification Julia Evans via GitGitGadget
2025-08-26 23:34   ` Junio C Hamano
2025-08-27 13:10     ` Julia Evans
2025-08-28 19:28   ` D. Ben Knoble
2025-09-12 18:55 ` [PATCH v2 0/4] doc: git-push: clarify DESCRIPTION section & refspec definition Julia Evans via GitGitGadget
2025-09-12 18:55   ` [PATCH v2 1/4] doc: git-push: clarify intro Julia Evans via GitGitGadget
2025-09-12 20:54     ` Junio C Hamano
2025-09-15 20:00       ` Julia Evans
2025-09-16  1:44         ` Junio C Hamano
2025-09-16 18:46           ` Julia Evans
2025-09-16 20:38             ` Ben Knoble
2025-09-16 21:59               ` Junio C Hamano
2025-09-17 18:42           ` Junio C Hamano
2025-09-18 14:20             ` Julia Evans
2025-09-12 18:55   ` [PATCH v2 2/4] doc: add an UPSTREAM BRANCHES section to pull/push/fetch Julia Evans via GitGitGadget
2025-09-12 21:17     ` Junio C Hamano
2025-09-15 20:19       ` Julia Evans
2025-09-15 21:48         ` Junio C Hamano
2025-09-15 23:09           ` Julia Evans
2025-09-16  5:25     ` Junio C Hamano
2025-09-16  5:33       ` Junio C Hamano
2025-09-16  5:39         ` Junio C Hamano
2025-09-18 21:02           ` Julia Evans
2025-09-12 18:55   ` [PATCH v2 3/4] doc: git-push: clarify "where to push" Julia Evans via GitGitGadget
2025-09-12 21:18     ` Junio C Hamano
2025-09-12 21:19     ` Junio C Hamano
2025-09-15 20:52       ` Julia Evans
2025-09-12 18:55   ` [PATCH v2 4/4] doc: git-push: clarify "what " Julia Evans via GitGitGadget
2025-09-23 17:44   ` [PATCH v3 0/4] doc: git-push: clarify DESCRIPTION section Julia Evans via GitGitGadget
2025-09-23 17:44     ` [PATCH v3 1/4] doc: git-push: clarify intro Julia Evans via GitGitGadget
2025-09-23 17:44     ` [PATCH v3 2/4] doc: add an UPSTREAM BRANCHES section to pull/push/fetch Julia Evans via GitGitGadget
2025-09-24 19:51       ` Junio C Hamano
2025-09-30 19:20         ` Julia Evans
2025-09-23 17:44     ` [PATCH v3 3/4] doc: git-push: clarify "where to push" Julia Evans via GitGitGadget
2025-09-23 17:44     ` [PATCH v3 4/4] doc: git-push: clarify "what " Julia Evans via GitGitGadget
2025-09-24 20:01       ` Junio C Hamano
2025-09-25 20:50         ` Julia Evans
2025-09-25 21:15           ` Junio C Hamano [this message]
2025-09-25 22:34             ` Julia Evans
2025-09-26  1:27               ` Junio C Hamano
2025-09-26 15:29                 ` Junio C Hamano
2025-09-26 17:31                   ` Julia Evans
2025-09-26 19:03                     ` Junio C Hamano
2025-09-26 22:27                       ` Julia Evans
2025-09-26 23:07                         ` Junio C Hamano
2025-09-28 21:38                           ` D. Ben Knoble
2025-09-23 17:56     ` [PATCH v3 0/4] doc: git-push: clarify DESCRIPTION section D. Ben Knoble
2025-09-30 19:58     ` [PATCH v4 0/5] " Julia Evans via GitGitGadget
2025-09-30 19:58       ` [PATCH v4 1/5] doc: git-push: clarify intro Julia Evans via GitGitGadget
2025-09-30 19:58       ` [PATCH v4 2/5] doc: add an UPSTREAM BRANCHES section to pull/push/fetch Julia Evans via GitGitGadget
2025-09-30 23:39         ` Junio C Hamano
2025-10-03 18:23           ` Julia Evans
2025-10-03 19:12             ` Junio C Hamano
2025-10-01 17:30         ` Jean-Noël AVILA
2025-10-03 17:54           ` Julia Evans
2025-09-30 19:58       ` [PATCH v4 3/5] doc: git-push: clarify "where to push" Julia Evans via GitGitGadget
2025-09-30 19:58       ` [PATCH v4 4/5] doc: git-push: clarify "what " Julia Evans via GitGitGadget
2025-09-30 21:01         ` Junio C Hamano
2025-10-01 17:36         ` Jean-Noël AVILA
2025-09-30 19:58       ` [PATCH v4 5/5] doc: git-push: Add explanation of `git push origin main` Julia Evans via GitGitGadget
2025-10-01 22:29         ` D. Ben Knoble
2025-10-03 17:58           ` Julia Evans
2025-10-01 22:28       ` [PATCH v4 0/5] doc: git-push: clarify DESCRIPTION section D. Ben Knoble
2025-10-06 18:58       ` [PATCH v5 " Julia Evans via GitGitGadget
2025-10-06 18:58         ` [PATCH v5 1/5] doc: git-push: clarify intro Julia Evans via GitGitGadget
2025-10-06 18:58         ` [PATCH v5 2/5] doc: add an UPSTREAM BRANCHES section to pull/push/fetch Julia Evans via GitGitGadget
2025-10-07 12:23           ` Kristoffer Haugsbakk
2025-10-07 13:35             ` Julia Evans
2025-10-07 18:35               ` D. Ben Knoble
2025-10-06 18:58         ` [PATCH v5 3/5] doc: git-push: clarify "where to push" Julia Evans via GitGitGadget
2025-10-06 18:58         ` [PATCH v5 4/5] doc: git-push: clarify "what " Julia Evans via GitGitGadget
2025-10-06 18:58         ` [PATCH v5 5/5] doc: git-push: Add explanation of `git push origin main` Julia Evans via GitGitGadget
2025-10-06 21:53         ` [PATCH v5 0/5] doc: git-push: clarify DESCRIPTION section D. Ben Knoble
2025-10-06 22:07         ` 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

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

  git send-email \
    --in-reply-to=xmqqzfaidyil.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=ben.knoble@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=julia@jvns.ca \
    --cc=kristofferhaugsbakk@fastmail.com \
    /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).