git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Jonathan Nieder" <jrnieder@gmail.com>,
	"Ramkumar Ramachandra" <artagnon@gmail.com>,
	"Git List" <git@vger.kernel.org>,
	"Duy Nguyễn" <pclouds@gmail.com>
Subject: Re: [ITCH] Specify refspec without remote
Date: Wed, 10 Apr 2013 13:27:48 -0400	[thread overview]
Message-ID: <20130410172748.GA16908@sigill.intra.peff.net> (raw)
In-Reply-To: <7v4nfenxzm.fsf@alter.siamese.dyndns.org>

On Wed, Apr 10, 2013 at 09:37:01AM -0700, Junio C Hamano wrote:

> > The missing case 4 is obviously:
> >
> >   dst=missing, refs=present
> > ...
> > Do you want to explain your thinking? I'm guessing it has to do with the
> > fact that choosing branch.*.remote is about trying to push to the
> > configured upstream (even though we traditionally do _not_ take into
> > account branch.*.merge when doing so).
> 
> With the branch.$name.remote, the user tells us "When I am on this
> branch, I want to talk to this remote".  When you did
> 
> 	git push -- master next ;# case #4
> 
> on branch maint, branch.maint.remote should not come into play.

I understand that's your position, but I don't understand _why_.

If branch.$name.remote is "when I am on this branch, I want to talk to
this remote", that rule is not be impacted by the presence of refspecs
at all.

If it meant "when I am on this branch, and I do not specify any
refspecs, then I would by default want to push this branch to that
remote", then your proposed behavior would make more sense. And if you
are using push.default=upstream, that is what happens.

But historically the default push has been "matching". So in your other
examples:

> Would we want to push our 'master' to branch.master.remote in a way 
> 
> 	git checkout master && git push
> 
> would do, while at the same time because we were told to do the same
> for 'next', we do the same as
> 
> 	git checkout next && git push

These do not have anything to do with pushing the checked-out branch in
particular. The first one may very well be pushing "next" to the remote
specified by branch.master.remote.

So I would argue that one of these two makes sense:

  1. branch.*.remote means "use this as the default remote on this
     branch, no matte which refs we are pushing"

  2. branch.*.remote is not respected at all for remote selection with
     "matching". It is used only when combined with branch.*.merge,
     which means that only the "upstream" mode would use it.

I advocated (1) in my previous message, but I would also be OK with (2),
even though it is a change from the current behavior. But what you are
suggesting seems like an inconsistent mix of the two.

> would do?  That would work if you give just branch names, but that
> is not a general enough definition to cover your case #4, e.g.
> 
> 	git push -- v1.2.3 master:refs/remotes/mothership/master
> 
> If we define case #4 to push to the remote.pushdefault (falling back
> to remote.default), this case would do what can simply be expected;
> if the earlier cases also push to that same place, ignoring
> branch.$name.remote for master and next, that would be consistent.

So I think what you are getting at is that branch.*.remote is about
saying "when we push X, it goes to remote Y". And with v1.2.3, we
obviously cannot have such a hint, because it is not a branch. But my
point is that is _not_ how it works today.  So if you want consistency,
we would also need to adjust how branch.*.remote interacts with
"matching".

-Peff

  reply	other threads:[~2013-04-10 17:28 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-18 16:58 [ITCH] Specify refspec without remote Ramkumar Ramachandra
2013-03-18 17:08 ` Jeff King
2013-03-19  9:58   ` Ramkumar Ramachandra
2013-03-19 10:02     ` Jeff King
2013-03-19 11:33   ` Duy Nguyen
2013-03-19 11:53     ` Ramkumar Ramachandra
2013-03-19 12:15       ` Duy Nguyen
2013-03-19 13:03         ` Holger Hellmuth (IKS)
2013-03-19 11:58     ` Holger Hellmuth (IKS)
2013-03-19 15:43       ` Junio C Hamano
2013-03-19 15:43     ` Junio C Hamano
2013-04-09 11:44   ` Ramkumar Ramachandra
2013-04-09 17:31     ` Junio C Hamano
2013-04-09 17:39       ` Ramkumar Ramachandra
2013-04-09 17:58         ` Junio C Hamano
2013-04-09 18:03           ` Ramkumar Ramachandra
2013-04-09 18:08             ` Ramkumar Ramachandra
2013-04-09 19:29             ` Junio C Hamano
2013-04-09 23:13               ` Jonathan Nieder
2013-04-09 23:14                 ` Jonathan Nieder
2013-04-10  1:19                 ` Junio C Hamano
2013-04-10  4:13                   ` Jeff King
2013-04-10 16:37                     ` Junio C Hamano
2013-04-10 17:27                       ` Jeff King [this message]
2013-04-10 18:54                         ` Junio C Hamano
2013-04-10 18:59                           ` Jeff King
2013-04-10 19:31                             ` Ramkumar Ramachandra
2013-04-10 19:33                               ` Ramkumar Ramachandra
2013-04-10 19:52                               ` Jeff King
2013-04-10 20:05                                 ` Ramkumar Ramachandra
2013-04-10 20:21                                   ` Jeff King
2013-04-10 20:41                                     ` Ramkumar Ramachandra
2013-04-10 21:02                                       ` Ramkumar Ramachandra
2013-04-10 21:32                                         ` Ramkumar Ramachandra
2013-04-10 20:21                                 ` Junio C Hamano
2013-04-10 19:53                               ` Ramkumar Ramachandra
2013-04-10 20:05                                 ` Jonathan Nieder
2013-04-10 20:11                                   ` Jeff King
2013-04-10 21:23                                     ` Jonathan Nieder
2013-04-10 20:05                                 ` Jeff King
2013-04-10 20:19                                   ` Ramkumar Ramachandra
2013-04-10 20:24                                     ` Jeff King
2013-04-10 20:55                                       ` Ramkumar Ramachandra
2013-04-10 21:04                                         ` Jeff King
2013-04-10 21:11                                           ` Ramkumar Ramachandra
2013-04-10 21:18                                             ` Jonathan Nieder
2013-04-10 21:23                                               ` Ramkumar Ramachandra
2013-04-10 21:29                                                 ` Jonathan Nieder
2013-04-10 21:42                                                   ` Ramkumar Ramachandra
2013-04-10 21:56                                                     ` Jeff King
2013-04-10 22:06                                                       ` Ramkumar Ramachandra
2013-04-10 22:16                                                         ` Jeff King
2013-04-10 22:11                                                       ` Ramkumar Ramachandra
2013-04-10 22:23                                                         ` Jeff King
2013-04-10 22:31                                                           ` Ramkumar Ramachandra
2013-04-11  7:38                                                           ` Ramkumar Ramachandra
2013-04-11  7:45                                                             ` Ramkumar Ramachandra
2013-04-11 21:40                                                             ` Junio C Hamano
2013-04-13  5:07                                                               ` Ramkumar Ramachandra
2013-04-10 20:27                                 ` Junio C Hamano
2013-04-10 21:15                                   ` Ramkumar Ramachandra
2013-04-12 22:14                             ` Junio C Hamano
2013-04-10  3:50                 ` Jeff King
2013-04-10 13:22                   ` Ramkumar Ramachandra
2013-04-10 15:56                     ` Jeff King
2013-04-10 16:38                   ` Junio C Hamano
2013-04-10 17:29                     ` Jeff King
2013-04-10 13:19                 ` Ramkumar Ramachandra

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=20130410172748.GA16908@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=pclouds@gmail.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).