git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Matthieu Moy" <Matthieu.Moy@grenoble-inp.fr>,
	"Marc Branchaud" <marcnarc@xiplink.com>,
	"Michael Haggerty" <mhagger@alum.mit.edu>,
	"Carlos Martín Nieto" <cmn@elego.de>,
	git@vger.kernel.org
Subject: Re: [RFC PATCH] push: start warning upcoming default change for push.default
Date: Mon, 12 Mar 2012 12:06:48 -0700	[thread overview]
Message-ID: <7vfwddskon.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20120312183725.GA2187@sigill.intra.peff.net> (Jeff King's message of "Mon, 12 Mar 2012 14:37:25 -0400")

Jeff King <peff@peff.net> writes:

> ... This is not a push.default issue,
> but I think it is somewhat related, and maybe worth discussing along
> with the topic of asymmetry. ...
> I've mostly trained my fingers to type "git push
> <my-publish-repo>", but I do occasionally forget.

In an assymmetric set-up, you would typically push into one place
but update from one or more places, so it might make sense to make
it easier to say "git push" and "git pull $there".  But that does
not solve the fundamental issue, I would think.

> Do other people with
> asymmetric workflows find this annoying? Do they not care? Or are many
> fewer people doing asymmetric things than I think?

I think it is not "they do not care", but "they do not have a good
solution".  I do not think of anything offhand, either.

> While I'm ranting, there's another weirdness I noticed. If I have
> push.default set to upstream, and config like this:
>
>   [branch "foo"]
>      remote = origin
>      merge = refs/heads/master
>
> then typing "git push" will go to foo's master branch. But if I type
> "git push other-remote", then it will go to other-remote's master
> branch. Which makes no sense to me. The upstream is foo's master, and
> now we are making guesses about how the names on each side are the same.
> Is this an intentional behavior?

Because "upstream" is meant to be "For the branch I am on, you know
how the branches map between the remote repository, so you already
know what the right thing to do---do it" mode, the correct "guess"
in your case is to error out and say "Nah, you are not talking with
your upstream, so I do not have any clue what branches you want to
push out and how. As you said that the push.default is upstream, not
matching, I refuse to even do the matching push in your case.  This
is an error. Be more specific".

> Actually, this is the thing that scares me the most about "upstream" as
> a default, because in this case, you are implicitly performing the
> equivalent of a fast-forward merge. So that's handy if you are a new
> user who wants to publish your work back to the master branch. But that
> has two problems:
>
>   1. If you are a new user who does like the implicit merge, you
>   may find it convenient not to have to learn about ... << and we
>   shouldn't discourage them from learning as it will be needed
>   anyway >>
>
>   2. If you are a new user who _doesn't_ want to do the merge, but
>   instead wants to publish your work-in-progress topic, then the
>   implicit merge-back-to-master behavior is wrong and dangerous.
>   << the newbie may push -f ruining the work of others >>

I agree with both points.  Also there is a cross-variant issue of
the above two:

	If a new user hears "not fast-forward, first pull and then
	push again", that will be done on a topic branch, merging
	'master' back and then pushing the result to 'master',
	leaving the 'master' of the user behind.

> So far a lot of the discussion has focused on "what is the most sensible
> default for the most number of people". But I wonder if a better
> question is "what is the default that is the least likely to do
> something dangerous and embarrassing". People who use git enough to say
> "wow, I don't like this default for my workflow" are probably at the
> point that they can configure push.default themselves.

I do not think "the most number of people" is a high-priority issue,
but "least damage" default may not be necessarily the best.

Obviously, "nothing" is the least-damage option, and looking at how
even people on this list cannot decide between current and upstream,
I actually am very tempted to suggest it as the new default.

  reply	other threads:[~2012-03-12 19:06 UTC|newest]

Thread overview: 116+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08 10:01 git push default behaviour? Jeremy Morton
2012-03-08 10:11 ` Thomas Rast
2012-03-08 10:13   ` Jeremy Morton
2012-03-08 10:28     ` Carlos Martín Nieto
2012-03-08 10:38       ` Jeremy Morton
2012-03-08 10:42         ` Carlos Martín Nieto
2012-03-08 10:43           ` Jeremy Morton
2012-03-08 18:22             ` Junio C Hamano
2012-03-08 18:35               ` Matthieu Moy
2012-03-08 19:03                 ` Andreas Krey
2012-03-08 19:29                 ` Junio C Hamano
2012-03-09  8:05                   ` Matthieu Moy
2012-03-09  9:50                     ` Junio C Hamano
2012-03-09 11:28                       ` Jeremy Morton
2012-03-09 11:54                       ` Matthieu Moy
2012-03-09 14:42                       ` Jakub Narebski
2012-03-19  6:02             ` Miles Bader
2012-03-19 16:12               ` Philippe Vaucher
2012-03-08 15:00           ` Marc Branchaud
2012-03-08 15:26             ` Matthieu Moy
2012-03-08 17:49               ` Dmitry Potapov
2012-03-08 18:04                 ` Matthieu Moy
2012-03-09  3:38                   ` Jeff King
2012-03-09  5:23                     ` Junio C Hamano
2012-03-09  5:38                       ` Junio C Hamano
2012-03-09  8:06                         ` demerphq
2012-03-09  8:48                           ` Thomas Rast
2012-03-09  9:50                             ` Junio C Hamano
2012-03-16  9:38                             ` Gelonida N
2012-03-09  8:25                       ` Matthieu Moy
2012-03-09  8:31                         ` [RFC PATCH] push: start warning upcoming default change for push.default Matthieu Moy
2012-03-09 10:01                           ` Junio C Hamano
2012-03-09 20:21                             ` Junio C Hamano
2012-03-09 10:25                           ` Carlos Martín Nieto
2012-03-09 18:30                             ` Marc Branchaud
2012-03-09 21:08                               ` Stefan Haller
2012-03-10 21:05                                 ` Junio C Hamano
2012-03-11 20:26                                   ` Stefan Haller
2012-03-12  8:47                                     ` Matthieu Moy
2012-03-12 11:22                                       ` Stefan Haller
2012-03-12 12:46                                         ` Matthieu Moy
2012-03-12 16:11                                           ` Junio C Hamano
2012-03-12 15:10                                 ` Marc Branchaud
2012-03-10  6:16                               ` Michael Haggerty
2012-03-12 15:13                                 ` Marc Branchaud
2012-03-12 16:37                                   ` Matthieu Moy
2012-03-12 17:53                                     ` Junio C Hamano
2012-03-12 18:37                                     ` Jeff King
2012-03-12 19:06                                       ` Junio C Hamano [this message]
2012-03-12 19:33                                         ` Junio C Hamano
2012-03-12 20:16                                         ` Marc Branchaud
2012-03-13  9:40                                           ` Matthieu Moy
2012-03-13  9:36                                         ` Matthieu Moy
2012-03-13 21:30                                         ` Jeff King
2012-03-13 22:54                                           ` Junio C Hamano
2012-03-14 13:50                                             ` Jeff King
2012-03-14 20:59                                               ` Junio C Hamano
2012-03-13  9:34                                       ` Matthieu Moy
2012-03-13 13:17                                         ` Junio C Hamano
2012-03-13 13:35                                           ` Matthieu Moy
2012-03-13 20:01                                             ` Auto-matching upstream branches by name (was: [RFC PATCH] push: start warning upcoming default change for push.default) Stefan Haller
2012-03-14  9:10                                               ` Auto-matching upstream branches by name Matthieu Moy
2012-03-13 14:31                                           ` [RFC PATCH] push: start warning upcoming default change for push.default Marc Branchaud
2012-03-13 14:59                                           ` Holger Hellmuth
2012-03-13 17:41                                             ` Junio C Hamano
2012-03-14 19:15                                               ` Holger Hellmuth
2012-03-15  8:02                                                 ` Matthieu Moy
2012-03-15 10:43                                                   ` Holger Hellmuth
2012-03-13 15:02                                           ` Andreas Ericsson
2012-03-13 21:35                                           ` Jeff King
2012-03-13 18:08                                         ` Dmitry Potapov
2012-03-14  4:46                                           ` Junio C Hamano
2012-03-14 12:47                                             ` Dmitry Potapov
2012-03-14 17:29                                               ` Junio C Hamano
2012-03-14 17:49                                                 ` Dmitry Potapov
2012-03-14 20:44                                                   ` Junio C Hamano
2012-03-14  9:07                                           ` Matthieu Moy
2012-03-14 13:23                                             ` Dmitry Potapov
2012-03-14 14:47                                               ` Matthieu Moy
2012-03-14 17:47                                                 ` Dmitry Potapov
2012-03-15  8:05                                                   ` Matthieu Moy
2012-03-14  8:59                                       ` Michael Haggerty
2012-03-14 14:00                                         ` Jeff King
2012-03-09 11:26                           ` Ævar Arnfjörð Bjarmason
2012-03-16  8:51                           ` Clemens Buchacher
2012-03-16  9:43                             ` Matthieu Moy
2012-03-16 12:05                               ` Junio C Hamano
2012-03-16 12:42                                 ` Matthieu Moy
2012-03-16 21:48                                   ` Clemens Buchacher
2012-03-17 20:46                                     ` Matthieu Moy
2012-03-19 16:11                           ` Andrew Myers
2012-03-09  9:57                         ` git push default behaviour? Junio C Hamano
2012-03-09 12:11                           ` Matthieu Moy
2012-03-09 16:22                             ` Junio C Hamano
2012-03-09 17:44                               ` Junio C Hamano
2012-03-09 14:56                           ` Jakub Narebski
2012-03-09 16:23                             ` Junio C Hamano
2012-03-13 15:18                               ` Jakub Narebski
2012-03-12  9:34                           ` Matthieu Moy
2012-03-12 16:29                             ` Junio C Hamano
2012-03-13  9:47                               ` Matthieu Moy
2012-03-13 12:34                                 ` Junio C Hamano
2012-03-16 19:35                                   ` Junio C Hamano
2012-03-17 15:49                           ` Eric Hanchrow
2012-03-08 17:37             ` Dmitry Potapov
2012-03-08 11:33         ` Jakub Narebski
2012-03-08 11:34           ` Jeremy Morton
2012-03-13 15:27             ` Jakub Narebski
2012-03-14 12:12               ` Jeremy Morton
2012-03-14 17:16                 ` Jakub Narebski
2012-03-08 11:54       ` Matthieu Moy
2012-03-08 12:12         ` demerphq
2012-03-17  9:36 ` Sebastien Douche
2012-03-17  9:38   ` Jeremy Morton
2012-03-17  9:51     ` Sebastien Douche
2012-03-18 10:26       ` Pavel Pospíšil

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=7vfwddskon.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=cmn@elego.de \
    --cc=git@vger.kernel.org \
    --cc=marcnarc@xiplink.com \
    --cc=mhagger@alum.mit.edu \
    --cc=peff@peff.net \
    /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).