All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jed Brown <jed@59a2.org>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Jeff King <peff@peff.net>, Max Horn <max@quendi.de>
Subject: Re: [PATCH v2 11/13] remote-hg: force remote push
Date: Thu, 04 Apr 2013 15:14:33 -0500	[thread overview]
Message-ID: <87ppyaqcie.fsf@59A2.org> (raw)
In-Reply-To: <CAMP44s1b_SWkVXe2Vyzs2yj1M9Z-2KcCXbp9LCJ_oWxuC+2pAg@mail.gmail.com>

Felipe Contreras <felipe.contreras@gmail.com> writes:

> If that's the case, they should disable in the server, just like some
> people disable non-fast-forward pushes in git.

I don't know how to make Hg allow new branches and bookmarks, but not
new anonymous heads.  Vanishly few Hg projects use a workflow anything
like topic branches so it's normally not a common thing to be creating
new heads.  If someone is using remote-hg, we can be pretty sure they
are not the primary maintainer, so if they are pushing, they'll be aware
of upstream policy and will need to play by those rules.

> The problem is Mercurial, purely and simple, without forcing the push,
> how do you expect this to work?
>
> % git clone hg::whatever
> % git checkout -b feature-a master
> # do stuff
> % git push -u origin feature-a

There is a difference between pushing a new branch (see 'hg push
--new-branch -b branch-name') and creating arbitrary new heads.  In a
very common case where multiple people are pushing to the same
branch/bookmark, force push creates new anonymous heads that share the
same branch.  (For less familiar readers, hg branches can have multiple
heads, though most commands will behave as though the latest head to
appear in the repository is the unique head associated with a given
branch.  Yes, it's insane.)

Normal workflow in case of new commits upstream is to 'hg pull --rebase' or
to pull and merge (yucky for first-parent, but most Hg users are far
from caring about such things).  Silently creating new anonymous heads
is a bad default.

Note: I don't know of any way to avoid the race condition when pushing
a bookmark that creates a new head since there is no 'hg push --new-bookmark'.

  reply	other threads:[~2013-04-04 20:15 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-04 15:30 [PATCH v2 00/13] remote-hg: general updates Felipe Contreras
2013-04-04 15:30 ` [PATCH v2 01/13] remote-hg: trivial cleanups Felipe Contreras
2013-04-04 15:30 ` [PATCH v2 02/13] remote-hg: add missing config variable in doc Felipe Contreras
2013-04-04 15:30 ` [PATCH v2 03/13] remote-hg: properly report errors on bookmark pushes Felipe Contreras
2013-04-04 15:30 ` [PATCH v2 04/13] remote-hg: fix for files with spaces Felipe Contreras
2013-04-04 15:30 ` [PATCH v2 05/13] remote-hg: make sure fake bookmarks are updated Felipe Contreras
2013-04-04 15:30 ` [PATCH v2 06/13] remote-hg: trivial test cleanups Felipe Contreras
2013-04-04 15:30 ` [PATCH v2 07/13] remote-hg: redirect buggy mercurial output Felipe Contreras
2013-04-04 16:40   ` Junio C Hamano
2013-04-04 15:30 ` [PATCH v2 08/13] remote-hg: split bookmark handling Felipe Contreras
2013-04-04 15:30 ` [PATCH v2 09/13] remote-hg: refactor export Felipe Contreras
2013-04-04 15:30 ` [PATCH v2 10/13] remote-hg: update remote bookmarks Felipe Contreras
2013-04-04 15:30 ` [PATCH v2 11/13] remote-hg: force remote push Felipe Contreras
2013-04-04 16:44   ` Junio C Hamano
2013-04-04 18:56     ` Felipe Contreras
2013-04-04 19:06       ` Junio C Hamano
2013-04-04 18:17   ` Jed Brown
2013-04-04 19:13     ` Felipe Contreras
2013-04-04 20:14       ` Jed Brown [this message]
2013-04-04 20:35         ` Felipe Contreras
2013-04-04 20:48           ` Jed Brown
2013-04-04 21:34             ` Felipe Contreras
2013-04-04 22:27               ` Jed Brown
2013-04-04 23:06                 ` Felipe Contreras
2013-04-05  6:31                 ` Joachim Schmitz
2013-04-05 12:16                   ` Jed Brown
2013-04-04 15:30 ` [PATCH v2 12/13] remote-hg: update tags globally Felipe Contreras
2013-04-04 15:30 ` [PATCH v2 13/13] remote-hg: push to the appropriate branch Felipe Contreras
2013-04-04 16:50   ` Junio C Hamano
2013-04-05  9:16     ` Felipe Contreras

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=87ppyaqcie.fsf@59A2.org \
    --to=jed@59a2.org \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=max@quendi.de \
    --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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.