Skip to content

Commit 017303e

Browse files
derrickstoleegitster
authored andcommitted
bundle: move capabilities to end of 'verify'
The 'filter' capability was added in 105c6f1 (bundle: parse filter capability, 2022-03-09), but was added in a strange place in the 'git bundle verify' output. The tests for this show output like the following: The bundle contains these 2 refs: <COMMIT1> <REF1> <COMMIT2> <REF2> The bundle uses this filter: blob:none The bundle records a complete history. This looks very odd if we have a thin bundle that contains boundary commits instead of a complete history: The bundle contains these 2 refs: <COMMIT1> <REF1> <COMMIT2> <REF2> The bundle uses this filter: blob:none The bundle requires these 2 refs: <COMMIT3> <COMMIT4> This separation between tip refs and boundary refs is unfortunate. Move the filter capability output to the end of the output. Update the documentation to match. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 831ee25 commit 017303e

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

Documentation/git-bundle.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ verify <file>::
7575
cleanly to the current repository. This includes checks on the
7676
bundle format itself as well as checking that the prerequisite
7777
commits exist and are fully linked in the current repository.
78-
Information about additional capabilities, such as "object filter",
79-
is printed. See "Capabilities" in link:technical/bundle-format.html
80-
for more information. Finally, 'git bundle' prints a list of
81-
missing commits, if any. The exit code is zero for success, but
82-
will be nonzero if the bundle file is invalid.
78+
Then, 'git bundle' prints a list of missing commits, if any.
79+
Finally, information about additional capabilities, such as "object
80+
filter", is printed. See "Capabilities" in link:technical/bundle-format.html
81+
for more information. The exit code is zero for success, but will
82+
be nonzero if the bundle file is invalid.
8383

8484
list-heads <file>::
8585
Lists the references defined in the bundle. If followed by a

bundle.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,6 @@ int verify_bundle(struct repository *r,
267267
(uintmax_t)r->nr);
268268
list_refs(r, 0, NULL);
269269

270-
if (header->filter.choice) {
271-
printf_ln("The bundle uses this filter: %s",
272-
list_objects_filter_spec(&header->filter));
273-
}
274-
275270
r = &header->prerequisites;
276271
if (!r->nr) {
277272
printf_ln(_("The bundle records a complete history."));
@@ -282,6 +277,10 @@ int verify_bundle(struct repository *r,
282277
(uintmax_t)r->nr);
283278
list_refs(r, 0, NULL);
284279
}
280+
281+
if (header->filter.choice)
282+
printf_ln("The bundle uses this filter: %s",
283+
list_objects_filter_spec(&header->filter));
285284
}
286285
return ret;
287286
}

t/t6020-bundle-misc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,8 @@ do
510510
<TAG-2> refs/tags/v2
511511
<TAG-3> refs/tags/v3
512512
<COMMIT-P> HEAD
513-
The bundle uses this filter: $filter
514513
The bundle records a complete history.
514+
The bundle uses this filter: $filter
515515
EOF
516516
test_cmp expect actual &&
517517

0 commit comments

Comments
 (0)