git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Idea: Git Bundle V3 capability @HEAD=ref/heads/<name>

From
Philip Oakley <philipoakley@iee.email>
Date
Oct 6, 2022, 15:55 UTC
Message-ID
<037901f1-1649-1485-a853-9783b9d43b31@iee.email>
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/
Next: Junio C Hamano
Message 1 of 3 in “Idea: Git Bundle V3 capability @HEAD=ref/heads/<name>”
  1. Philip OakleyOct 6, 2022
  2. Junio C HamanoOct 6, 2022
  3. brian m. carlsonOct 7, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.