git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Christopher Head <bugs@chead.ca>
Cc: git@vger.kernel.org
Subject: Re: Push force-with-lease with multi-URL remote
Date: Mon, 29 Jul 2019 06:20:10 -0400	[thread overview]
Message-ID: <20190729102009.GC2755@sigill.intra.peff.net> (raw)
In-Reply-To: <20190727095440.1aac3b3c@amdahl.home.chead.ca>

On Sat, Jul 27, 2019 at 09:54:40AM -0700, Christopher Head wrote:

> For each URL:
> 1. Read refs/heads/mybranch (call this commit X)
> 2. Read refs/remotes/myremote/mybranch (call this commit Y)
> 3. Send to the URL an atomic compare-and-swap, replacing Y with X.
> 4. If step 3 succeeded, change refs/remotes/myremote/mybranch to X.
> 
> This means that, assuming both URLs start out identical, the second URL
> will always fail because refs/remots/myremote/mybranch has been updated
> from Y to X, and therefore the second compare-and-swap fails. I can’t
> imagine any situation in which this behaviour is actually useful.

My general feeling is that having multiple push URLs for a remote is a
poorly designed feature in Git (and I think the discussion elsewhere in
this thread went there, as well).

But since we do have it, and if we are not going to deprecate it[1], it
seems like this case should pick the X value of myremote/mybranch ahead
of time, and then use it consistently for each push. There are questions
of partial push failures, etc, but as you note the current behavior
isn't ever useful. I think it just a case where two features do not
interact well (and since neither is used all that frequently, nobody has
noticed).

-Peff

[1] I would not be at all sad to see multiple URLs like this get
    deprecated in favor of multiple remotes with convenient grouping
    options. If that happens, then your original problem goes away. ;)

  parent reply	other threads:[~2019-07-29 10:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-27 16:54 Push force-with-lease with multi-URL remote Christopher Head
2019-07-27 17:46 ` Junio C Hamano
2019-07-27 18:15   ` Christopher Head
2019-07-27 20:57     ` Junio C Hamano
2019-07-27 21:43       ` Christopher Head
2019-07-29  5:19         ` Junio C Hamano
2019-07-29 10:20 ` Jeff King [this message]
2019-07-29 13:33   ` Junio C Hamano
2019-07-29 13:47     ` Christopher Head
2019-07-29 19:20     ` Jeff King
2019-07-29 21:44       ` Junio C Hamano
2019-07-29 22:29         ` Jeff King

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=20190729102009.GC2755@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=bugs@chead.ca \
    --cc=git@vger.kernel.org \
    /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).