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

Re: [PATCH v3] doc: describe Git bundle format

From
Masaya Suzuki <masayasuzuki@google.com>
Date
Feb 12, 2020, 22:13 UTC
Message-ID
<CAJB1erWuCTYtGdjiwBT3hhbH5Jrdr+cE8duwtoH=P7Fe6BmUpg@mail.gmail.com>
In-Reply-To
<xmqqa75t3l1h.fsf@gitster-ct.c.googlers.com>
On Fri, Feb 7, 2020 at 5:49 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
>
> Masaya Suzuki <masayasuzuki@google.com> writes:
>
> > Yes. The reason that I've been trying to check the semantics of the
> > prerequisites is that I DO recognize that this is possible
> > format-wise. I'm not sure if this Git implementation can create such
> > bundles, but format-wise such bundles can be created.
>
> Yeah, now I get it.
>
> The problem is *not* that v2 format "cannot represent a shallow
> clone repository", but is that there is nothing that prevents a
> bundle in v2 format from depending on objects behind (not just at)
> the shallow boundary, making it impossible for a reader to guarantee
> that a bundle with prereqs can be used to create an equivalent
> shallow repository with shallow boundary at the same place as
> prereqs.  IOW, bundle with prereqs in the v2 format allows more
> objects to be omitted than an equivalent shallow repository omits,
> because prereqs and shallow cutoff points mean different things.

Yes. So, I think it's better to say prereqs and shallow boundaries are different.

Show 10 quoted lines
> While we are at it, I suspect that with reachability bitmap, a "git
> fetch" that updates a history up to commit A to a new history up to
> commit B can omit more objects than what is directly reachable from
> the commit A.  That is, if A's direct child (call it C) is a commit
> that reverts A, a blob in A's tree won't be in the bundle (because A
> is a prereq), but the blob at the same path in C is the same blob as
> the blob at the same path in A's parent (that is what it means for
> that A's direct child to be a revert of A).  In the normal
> enumeration based on object-walk to decide which objects to send,
> such a blob in C will be included in the pack,

That's interesting. I have never looked CGit's implementation, but I think JGit would omit those objects. (At least that was my understanding. Not confirmed with the code.)

Anyway. Is it OK with adding this small note on "prereq is not a shallow boundary"? In practice, there are not many Git implementations that handle Git bundles, so it's not that big deal as long those few implementers recognize this, but this document is meant for those implementers.

Previous: Junio C HamanoNext: Junio C Hamano
Message 15 of 16 in “doc: describe Git bundle format”
  1. doc: describe Git bundle formatMasaya Suzuki, Jan 30, 2020
  2. Johannes SchindelinJan 31, 2020
  3. Junio C HamanoJan 31, 2020
  4. Masaya SuzukiJan 31, 2020
  5. Junio C HamanoJan 31, 2020
  6. Masaya SuzukiJan 31, 2020
  7. Junio C HamanoFeb 4, 2020
  8. doc: describe Git bundle formatMasaya Suzuki, Jan 31, 2020
  9. Junio C HamanoJan 31, 2020
  10. doc: describe Git bundle formatMasaya Suzuki, Feb 7, 2020
  11. Masaya SuzukiFeb 7, 2020
  12. Junio C HamanoFeb 7, 2020
  13. Masaya SuzukiFeb 7, 2020
  14. Junio C HamanoFeb 8, 2020
  15. Masaya SuzukiFeb 12, 2020
  16. Junio C HamanoFeb 12, 2020

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.