git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Idea: Git Bundle V3 capability @HEAD=ref/heads/<name>
       [not found] <8d88ba68-4585-634b-1fe0-61c3465fa682@iee.email>
@ 2022-10-06 15:55 ` Philip Oakley
  2022-10-06 18:45   ` Junio C Hamano
  2022-10-07  9:02   ` brian m. carlson
  0 siblings, 2 replies; 3+ messages in thread
From: Philip Oakley @ 2022-10-06 15:55 UTC (permalink / raw)
  To: Git List; +Cc: brian m. carlson, Andreas Krey

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/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Idea: Git Bundle V3 capability @HEAD=ref/heads/<name>
  2022-10-06 15:55 ` Idea: Git Bundle V3 capability @HEAD=ref/heads/<name> Philip Oakley
@ 2022-10-06 18:45   ` Junio C Hamano
  2022-10-07  9:02   ` brian m. carlson
  1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2022-10-06 18:45 UTC (permalink / raw)
  To: Philip Oakley; +Cc: Git List, brian m. carlson, Andreas Krey

Philip Oakley <philipoakley@iee.email> writes:

> 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>

Whatever you do, I think it should model what the protocol between
"git fetch" and "git upload-pack" use to convey where the symbolic
refs point at.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Idea: Git Bundle V3 capability @HEAD=ref/heads/<name>
  2022-10-06 15:55 ` Idea: Git Bundle V3 capability @HEAD=ref/heads/<name> Philip Oakley
  2022-10-06 18:45   ` Junio C Hamano
@ 2022-10-07  9:02   ` brian m. carlson
  1 sibling, 0 replies; 3+ messages in thread
From: brian m. carlson @ 2022-10-07  9:02 UTC (permalink / raw)
  To: Philip Oakley; +Cc: Git List, Andreas Krey

[-- Attachment #1: Type: text/plain, Size: 1497 bytes --]

On 2022-10-06 at 15:55:49, Philip Oakley wrote:
> 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?

I think this is a great idea.  I might suggest
"symref=HEAD:refs/heads/<name>" simply because it allows us to specify
more than one symref if we feel like it in the future, but otherwise I
have no objections.

I'm glad someone's finding my v3 bundle work more generally useful.
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-07  9:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <8d88ba68-4585-634b-1fe0-61c3465fa682@iee.email>
2022-10-06 15:55 ` Idea: Git Bundle V3 capability @HEAD=ref/heads/<name> Philip Oakley
2022-10-06 18:45   ` Junio C Hamano
2022-10-07  9:02   ` brian m. carlson

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).