git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philip Oakley <philipoakley@iee.email>
To: Git List <git@vger.kernel.org>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>,
	Andreas Krey <a.krey@gmx.de>
Subject: Idea: Git Bundle V3 capability @HEAD=ref/heads/<name>
Date: Thu, 6 Oct 2022 16:55:49 +0100	[thread overview]
Message-ID: <037901f1-1649-1485-a853-9783b9d43b31@iee.email> (raw)
In-Reply-To: <8d88ba68-4585-634b-1fe0-61c3465fa682@iee.email>

In brian's recent work on V3 bundles [1, et al] I spotted a potential
idea for resolving the long standing problem that the bundle code may
need to guess at which ref HEAD was pointed [2, et al] at when there
were two branches that pointed at the same HEAD oid.

The basic idea is to utilise the new 'capabilities' field to pass the
particular ref that is HEAD using a 'HEAD' capability
i.e. sending the capability    @HEAD=ref/heads/<name>

It's inclusion in the header wouldn't change the pack in any way, and
would resolve the guessing problem.

It would be optional for those that don't want to explictly export the
HEAD ref's name, and could be also protected by requiring that HEAD is
listed in the pack, and maybe that the ref it points to is also
included, and maybe further that there is an alternate ambigous ref listed.

The idea of the HEAD capability could also be extended to the transport
layer, as well as this bundle sneaker-net layer.

Are there reasons why it couldn't work before I put it on my list of ideas?

Philip

[1] see
https://lore.kernel.org/git/20200726195424.626969-32-sandals@crustytoothpaste.net/
[PATCH v4 31/39] bundle: add new version for use with SHA-256

[2] https://lore.kernel.org/git/20130906155204.GE12966@inner.h.apk.li/


       reply	other threads:[~2022-10-06 15:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8d88ba68-4585-634b-1fe0-61c3465fa682@iee.email>
2022-10-06 15:55 ` Philip Oakley [this message]
2022-10-06 18:45   ` Idea: Git Bundle V3 capability @HEAD=ref/heads/<name> Junio C Hamano
2022-10-07  9:02   ` brian m. carlson

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=037901f1-1649-1485-a853-9783b9d43b31@iee.email \
    --to=philipoakley@iee.email \
    --cc=a.krey@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=sandals@crustytoothpaste.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 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).