git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Matthieu Moy" <Matthieu.Moy@grenoble-inp.fr>,
	"Jeff King" <peff@peff.net>,
	"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: Tue, 13 Mar 2012 16:02:50 +0100	[thread overview]
Message-ID: <4F5F619A.3040806@op5.se> (raw)
In-Reply-To: <7vehswljxi.fsf@alter.siamese.dyndns.org>

On 03/13/2012 02:17 PM, Junio C Hamano wrote:
> Matthieu Moy<Matthieu.Moy@grenoble-inp.fr>  writes:
> 
>> There's a rule of thumb which works very well for beginners: when "git
>> push" tells you to pull before, then pull before. This rule of thumb
>> works, but only provided "push" and "pull" are symmetrical.
> 
> I actually think the "pull before push again" was written with only
> CVS style non-branching workflow in mind, in other words, only to
> help somebody who works on his master against the central master.
> Obviously "push and pull are symmetrical" holds true for that single
> branch workflow, but that does not mean a more complex workflow must
> be symmetrical.
> 
> Even though I think 'upstream' will be a superset of what 'current'
> wants to do in an ideal world where the user configures everything
> right (hence it ought to be the better default between the two), I
> do not think that the target audience "let's change the default"
> folks are trying to help is those who set @{upstream} correctly
> point the destination for a branch they want to push to and leave it
> unset for a strictly private branch. If we choose the default that
> would primarily make it efficient for people who can configure
> everything right, we are missing the point of this discussion. I
> think the target audience to be helped is the people who do not
> (yet) do anything complex, and the point of this discussion is to
> help them avoid getting surprised.
> 
> And by "surprised", I do not necessarily mean "dangerous". While we
> should aim to avoid "dangerous", we should avoid "ununderstandable"
> even more.
> 
> Pushing 'current' from a branch 'topic' forked from either 'master'
> or 'origin/master' will create a new branch 'topic' at the central
> repository. But that is straightforward and understandable. The user
> will see what happened in the feedback from the command, and there
> is no need for the user to be experienced enough to know the mapping
> of @{upstream} to understand why it happened.  "I am on 'topic' and
> I pushed, I created 'topic' there".  Very simple explanation exists.
> 
> On the other hand, the user needs to know not just 'branch' but also
> understand the concept of @{upstream} in order to use 'upstream'
> without surprise.  When something goes wrong, prerequisite knowledge
> that is required to understand it is greater.  Also the current
> implementation of 'upstream' has some weird semantics (or undesigned
> bugs) pointed out by Peff, which would make it even more confusing.
> 
> That makes me suspect that 'current' might be a more appropriate
> default between the two. From that simple default, those in the
> "shared central repository" world can graduate to 'upstream' once
> they know what an 'upstream' is and how to take advantage of
> per-branch configuration.  Similarly, those in the "publish to be
> pulled" world would graduate to 'matching'.


Sensible sentiments, sir.

Even with advanced usage, 'current' is what I think does the right
thing in 99% of all cases, and it errs on the side of "least extra
work when things go wrong".

The questions to ask, I think, are these:
* What would newcomers to git expect?
You answered this nicely.

* What does advanced users use *most of the time*?
At $dayjob, 99.9% of all pushes are to get the changes of the current
branch to the sharepoint repo. Once in a while (when tagging, usually
whatnot) for some repositories, I wish to push maint and master to a
public repository for the masses to use. This happens roughly once
every 200 commits, according to a quick "git log" in two repos, but
only for about 10 or so of the 60-odd repos we're maintaining, and
only for two of the six developers working on them.
It's very rare that I work on multiple already-created topics and
they all finish at the same time. At most, I wish to push "maint"
and "master" in one go.

If I notice I've done the bad push, I need to make sure noone else
fetched the thing during the time it takes me to undo the push, or
I may have to quickly fix up the potentially broken branch. Either
way, it can be a lot of work that I rarely have time for right then.


* What causes the least damage when the default is less suitable?
Quite a few times I've managed to push work-in-progress commits to
random topics at work with the default "matching". If I miss that
I've done so, undoing the damage is a great big pain in the butt,
since it means either force-pushing to sharepoint or un-bisectable
commits. The worst case for "current" would be if I merge one branch
to master, forget to push the merged branch but do push 'master'
to our sharepoint, and then someone else comes along and works a
bit more on the topic I accidentally didn't push. When that happens,
I can quite easily rebase my changes on top of the other devs, or
merge with the sharepoint changes, and then re-merge to master
without having to call a flag-day for the devs working on the same
project.

If I notice I've forgotten to push, I can just push again immediately
and git will handle any errors for me. It never leads to any extra
work for me, and never stalls anyone else from progressing with their
own tasks.


In light of that, "current" is really the only sensible way to go.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

  parent reply	other threads:[~2012-03-13 15:03 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
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 [this message]
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=4F5F619A.3040806@op5.se \
    --to=ae@op5.se \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=cmn@elego.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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).