git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Kyle Meyer <kyle@kyleam.com>
Cc: git@vger.kernel.org
Subject: Re: push docs: inaccurate description of omitted destination?
Date: Mon, 13 May 2019 18:18:21 +0900	[thread overview]
Message-ID: <xmqqimuebtlu.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <87sgtj6mo3.fsf@kyleam.com> (Kyle Meyer's message of "Sun, 12 May 2019 23:47:08 -0400")

Kyle Meyer <kyle@kyleam.com> writes:

> It seems to me that push's manpage contains a couple of inaccurate (or
> at least confusingly incomplete) statements about omitting the
> destination part of the refspec.
>
> First, the refspec section of the manpage has this to say:
>
>     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
>     without any `<refspec>` on the command line.  Otherwise, missing
>     `:<dst>` means to update the same ref as the `<src>`.
>
> Reading that, I'd think that, if I haven't configured
> remote.<repository>.push in a way that involves <src>, omitting <dst>
> will update the remote ref with the same name.

... if such a push would update the ref at the remote with the same
name, yes.  Otherwise no.  And that is determined by what push mode
is being used (e.g. are we using the matching mode?  The current
mode?  Something else?).

>  But push.default is also
> consulted before falling back entirely to using the remote ref with the
> same name:

Yes.  The push.default configuration participates in the selection
of the ref at the remote that gets updated, given a refspec element
with a missing :<dst>.  And you do not have to write :<dst> to name
the ref that a refspec with missing :<dst> would update anyway.

>     `git push origin master`::
>        Find a ref that matches `master` in the source repository
>        (most likely, it would find `refs/heads/master`), and update
>        the same ref (e.g. `refs/heads/master`) in `origin` repository
>        with it.  If `master` did not exist remotely, it would be
>        created.
>
> Perhaps I'm misreading that, but I'd interpret that as saying the remote
> ref with the same name will always be updated,...

That part is random listing of examples with vanilla configuration,
so depending on what setting you personally have, the behaviour may
be different.

      reply	other threads:[~2019-05-13  9:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-13  3:47 push docs: inaccurate description of omitted destination? Kyle Meyer
2019-05-13  9:18 ` Junio C Hamano [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

  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=xmqqimuebtlu.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=kyle@kyleam.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).