git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Lars Berntzon via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,
	Lars Berntzon <lars.berntzon@cecilia-data.se>,
	Lars Berntzon <lars.berntzon@external.atlascopco.com>
Subject: Re: [PATCH] doc: attempt to clarify a blurry sentence.
Date: Fri, 07 May 2021 07:03:52 +0900	[thread overview]
Message-ID: <xmqqzgx7wmd3.fsf@gitster.g> (raw)
In-Reply-To: <pull.1019.git.git.1620319023972.gitgitgadget@gmail.com> (Lars Berntzon via GitGitGadget's message of "Thu, 06 May 2021 16:37:03 +0000")

"Lars Berntzon via GitGitGadget" <gitgitgadget@gmail.com> writes:

> diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
> index a953c7c38790..bbb30c52395e 100644
> --- a/Documentation/git-push.txt
> +++ b/Documentation/git-push.txt
> @@ -66,10 +66,10 @@ it can be any arbitrary "SHA-1 expression", such as `master~4` or
>  The <dst> tells which ref on the remote side is updated with this
>  push. Arbitrary expressions cannot be used here, an actual ref must
>  be named.
> -If `git push [<repository>]` without any `<refspec>` argument is set to
> -update some ref at the destination with `<src>` with
> -`remote.<repository>.push` configuration variable, `:<dst>` part can
> -be omitted--such a push will update a ref that `<src>` normally updates
> +If `git push [<repository>]` without any `<refspec>` argument then
> +git will update the remote ref as defined by `remote.<repository>.push` configuration
> +and it will be updated from HEAD.
> +`:<dst>` part can be omitted--such a push will update a ref that `<src>` normally updates

Hmph, "If X then Git will do Y" expects X to be a full sentence with
subject and verb, but I do not see any verb in 

    `git push [<repository>]` without any `<refspec>` argument

in the rewritten version.

More importantly, the updated description is wrong.  The original
may be hard to follow, but what it is trying to explain is the
following.

Imagine that you have configured

	[remote "origin"]
		push = refs/heads/*:refs/remotes/satellite/*

Imagine further that you have a local branch 'next' and you want to
push it out to the "origin".  You also have other local branches
like 'master' and 'maint', but you do not wish to push them out
right now.

Under such a scenario, if you were to type

    $ git push origin

(i.e. "`git push [<repository>]` without `<refspec>` argument"),
such a command is set to update `refs/remotes/satellite/next`
(i.e. "some ref") at the "origin" (i.e. "the destination") with
`next` (i.e. "with <src>") via the remote.origin.push configuration
variable.  So this scenario satisfies the precondition of the
description we are discussing.

In such a case, you do not have to fully spell out

    $ git push origin next:refs/remotes/satellite/next

in order to push your 'next' branch (which may not be the current
branch) from the command line to its usual/configured destination.

Instead, you can omit ":<dst>", i.e.

    $ git push origin next

and such a push will update the remote ref that would be normally
updated by the local ref named on the command line, i.e. the remote
'refs/remotes/satellite/next' will be updated with your local
'refs/heads/next'.  But your 'master' and 'maint' will not be pushed
to their usual/configured destinations with such a push.

Again, the original may hard to read and it can use some rewriting
to make it easier to read.  Thanks for trying to help by attempting,
and another try with the above information in mind is greatly
appreciated.


  reply	other threads:[~2021-05-06 22:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06 16:37 [PATCH] doc: attempt to clarify a blurry sentence Lars Berntzon via GitGitGadget
2021-05-06 22:03 ` Junio C Hamano [this message]
2021-05-07  8:35 ` Lars Berntzon

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=xmqqzgx7wmd3.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=lars.berntzon@cecilia-data.se \
    --cc=lars.berntzon@external.atlascopco.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.
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).