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

Re: [PATCH v5 2/3] bundle doc: elaborate on object prerequisites

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 2, 2021, 15:10 UTC
Message-ID
<xmqq7di8rbtj.fsf@gitster.g>
In-Reply-To
<patch-2.3-444b06740bc-20210702T112254Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
Show 38 quoted lines
> Split out the discussion bout "object prerequisites" into its own
> section, and add some more examples of the common cases.
>
> See 2e0afafebd (Add git-bundle: move objects and references by
> archive, 2007-02-22) for the introduction of the documentation being
> changed here.
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  Documentation/git-bundle.txt | 26 +++++++++++++++++++++++---
>  1 file changed, 23 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt
> index 9c743aed49f..f5430029b8c 100644
> --- a/Documentation/git-bundle.txt
> +++ b/Documentation/git-bundle.txt
> @@ -45,6 +45,7 @@ header is (mostly) in the format emitted by linkgit:git-show-ref[1].
>  
>  Like the the packed archive format itself bundles can either be
>  self-contained, or be created using exclusions.
> +See the "OBJECT PREREQUISITES" section below.
>  
>  Bundles created using revision exclusions are "thin packs" created
>  using the `--thin` option to linkgit:git-pack-objects[1], and
> @@ -153,19 +154,38 @@ contained in the union of the given bases.  Each basis can be
>  specified explicitly (e.g. `^master~10`), or implicitly (e.g.
>  `master~10..master`, `--since=10.days.ago master`).
>  
> -It is very important that the basis used be held by the destination.
> +OBJECT PREREQUISITES
> +--------------------
> +
> +When creating bundles it is possible to create a fully self-contained
> +bundle with all the prerequisite objects, as well as providing
> +negative revisions to exclude prerequisite objects.
> +
> +A revision such as `new` will produce a tip with all the prerequisite
> +objects needed for the `new` reference.

The above two paragraphs use the word "prerequisites" in a confusing way. The original meaning of the word in the context of talking about a bundle is "you must have these commits in the receiving repository for the bundle to be unbundle-able".

"git bundle create recent.bndl old..new" creates a bundle that requires 'old' (and everything reachable from it) to exist in the receiving repository. We call the object 'old' (not the objects reachable from it) the prerequisite of the bundle.

"git bundle create full.bndl new" creates a bundle that needs no prerequistes.

It is confusing to say that full.bndl has all the prerequisite objects needed. It is correct to say that it has all the objects reachable from 'new', but if we wanted to say that, we did not have to introduce the new term "prerequisite" when we invented the bundle format. The concept "prerequisite" tries to convey is different.

So, the two paragraphs above use the word "prerequisite" when it wants to talk about "reachable objects" (except for one use---the one in "to exclude prerequisite objects" is correctly used), which is confusing. Here is the first paragraph with probably a better phrasing.

	... it is possible to create a self-contained bundle that
	can be unbundled in an empty repository, as well as
	providing negative revisions to exclude objects needed in
	the earlier parts of the history.
As to the second paragraph:
	... will produce a bundle without any prerequisites.  It can
	be unbundled in any repository to obtain a full history that
	leads to the commit `new`.

By the way, I needed to read "a revision such as `new` will produce ..." three times before realizing that the reader must fill quite a lot of missing words to understand what the sentence wanted to say, which is:

	(feeding) a revision such as `new` (to "git bundle create"
	as the revision range argument) will produce ...
I think it is easier to follow if you spelled the command out, e.g.
    A command
    $ git bundle create full.bndl new
    will create a bundle file that contains all the objects
    reachable from the branch 'new'.
> +A revision range such as `old..new` will produce a bundle tip that'll
> +require any objects existing before `new` to already be present in the
> +repository performing the 'git bundle unbundle' operation.
Getting warmer ;-).  In this case, 'old' is the prerequisite, so
    ... that'll require the commit 'old' (and any objects reachable
    from it) to exist for the bundle to be "unbundle"-able.
would be correct.
> +A self-contained bundle without any prerequisites can be extracted
> +into anywhere, even into an empty repository, or be cloned from
> +(i.e., `new`, but not `old..new`).
> +
This is entirely correct.
> +The 'git bundle verify' command can be used to check whether your
> +recipient repository has the required prerequisite commits for a
> +bundle.
So is this.
Thanks.
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 18 of 41 in “bundle doc: rewrite the "DESCRIPTION" section”
  1. bundle doc: rewrite the "DESCRIPTION" sectionÆvar Arnfjörð Bjarmason, Jun 7, 2021
  2. bundle doc: rewrite the "DESCRIPTION" sectionÆvar Arnfjörð Bjarmason, Jun 7, 2021
  3. Junio C HamanoJun 7, 2021
  4. 0/3 bundle doc: generaliz & elaborateÆvar Arnfjörð Bjarmason, Jun 24, 2021
  5. 1/3 bundle doc: rewrite the "DESCRIPTION" sectionÆvar Arnfjörð Bjarmason, Jun 24, 2021
  6. Junio C HamanoJun 29, 2021
  7. 2/3 bundle doc: split out thin v.s. not discussion from <rev-arg>Ævar Arnfjörð Bjarmason, Jun 24, 2021
  8. Junio C HamanoJun 29, 2021
  9. 3/3 bundle doc: elaborate on rev<->ref restrictionÆvar Arnfjörð Bjarmason, Jun 24, 2021
  10. 0/3 bundle doc: generalize & elaborateÆvar Arnfjörð Bjarmason, Jun 30, 2021
  11. 2/3 bundle doc: split out open v.s. closed discussion from <rev-arg>Ævar Arnfjörð Bjarmason, Jun 30, 2021
  12. Junio C HamanoJun 30, 2021
  13. 1/3 bundle doc: rewrite the "DESCRIPTION" sectionÆvar Arnfjörð Bjarmason, Jun 30, 2021
  14. 3/3 bundle doc: elaborate on rev<->ref restrictionÆvar Arnfjörð Bjarmason, Jun 30, 2021
  15. 0/3 bundle doc: generalize & elaborateÆvar Arnfjörð Bjarmason, Jul 2, 2021
  16. 1/3 bundle doc: rewrite the "DESCRIPTION" sectionÆvar Arnfjörð Bjarmason, Jul 2, 2021
  17. 2/3 bundle doc: elaborate on object prerequisitesÆvar Arnfjörð Bjarmason, Jul 2, 2021
  18. Junio C HamanoJul 2, 2021
  19. 3/3 bundle doc: elaborate on rev<->ref restrictionÆvar Arnfjörð Bjarmason, Jul 2, 2021
  20. 0/3 bundle doc: generalize & elaborateÆvar Arnfjörð Bjarmason, Jul 20, 2021
  21. 2/3 bundle doc: elaborate on object prerequisitesÆvar Arnfjörð Bjarmason, Jul 20, 2021
  22. Junio C HamanoJul 20, 2021
  23. 3/3 bundle doc: elaborate on rev<->ref restrictionÆvar Arnfjörð Bjarmason, Jul 20, 2021
  24. Junio C HamanoJul 20, 2021
  25. Philip OakleyJul 21, 2021
  26. Junio C HamanoJul 21, 2021
  27. Philip OakleyJul 22, 2021
  28. Ævar Arnfjörð BjarmasonJul 22, 2021
  29. Philip OakleyJul 22, 2021
  30. 1/3 bundle doc: rewrite the "DESCRIPTION" sectionÆvar Arnfjörð Bjarmason, Jul 20, 2021
  31. 0/3 bundle doc: generalize & elaborateÆvar Arnfjörð Bjarmason, Jul 27, 2021
  32. 1/3 bundle doc: rewrite the "DESCRIPTION" sectionÆvar Arnfjörð Bjarmason, Jul 27, 2021
  33. 2/3 bundle doc: elaborate on object prerequisitesÆvar Arnfjörð Bjarmason, Jul 27, 2021
  34. 3/3 bundle doc: elaborate on rev<->ref restrictionÆvar Arnfjörð Bjarmason, Jul 27, 2021
  35. Philip OakleyJul 28, 2021
  36. Junio C HamanoJul 28, 2021
  37. 0/3 bundle doc: generalize & elaborateÆvar Arnfjörð Bjarmason, Jul 31, 2021
  38. 1/4 bundle doc: rewrite the "DESCRIPTION" sectionÆvar Arnfjörð Bjarmason, Jul 31, 2021
  39. 2/4 bundle doc: elaborate on object prerequisitesÆvar Arnfjörð Bjarmason, Jul 31, 2021
  40. 3/4 bundle doc: elaborate on rev<->ref restrictionÆvar Arnfjörð Bjarmason, Jul 31, 2021
  41. 4/4 bundle doc: replace "basis" with "prerequsite(s)"Ævar Arnfjörð Bjarmason, Jul 31, 2021

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.