]> git.ipfire.org Git - thirdparty/git.git/commitdiff
bundle: move capabilities to end of 'verify'
authorDerrick Stolee <derrickstolee@github.com>
Tue, 22 Mar 2022 17:28:38 +0000 (17:28 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 Mar 2022 20:13:59 +0000 (13:13 -0700)
The 'filter' capability was added in 105c6f14a (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 <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-bundle.txt
bundle.c
t/t6020-bundle-misc.sh

index ac4c4352aae8ae12bdaf9f10413eb6ac12a7eb6d..7685b570455cadc243929deecc197776326dfeba 100644 (file)
@@ -75,11 +75,11 @@ verify <file>::
        cleanly to the current repository.  This includes checks on the
        bundle format itself as well as checking that the prerequisite
        commits exist and are fully linked in the current repository.
-       Information about additional capabilities, such as "object filter",
-       is printed. See "Capabilities" in link:technical/bundle-format.html
-       for more information. Finally, 'git bundle' prints a list of
-       missing commits, if any. The exit code is zero for success, but
-       will be nonzero if the bundle file is invalid.
+       Then, 'git bundle' prints a list of missing commits, if any.
+       Finally, information about additional capabilities, such as "object
+       filter", is printed. See "Capabilities" in link:technical/bundle-format.html
+       for more information. The exit code is zero for success, but will
+       be nonzero if the bundle file is invalid.
 
 list-heads <file>::
        Lists the references defined in the bundle.  If followed by a
index e359370cfcdc7d92077f1e3403d7f6529189de67..276b55f8ce25a22ffd04f6647b2de01525b15470 100644 (file)
--- a/bundle.c
+++ b/bundle.c
@@ -267,11 +267,6 @@ int verify_bundle(struct repository *r,
                          (uintmax_t)r->nr);
                list_refs(r, 0, NULL);
 
-               if (header->filter.choice) {
-                       printf_ln("The bundle uses this filter: %s",
-                                 list_objects_filter_spec(&header->filter));
-               }
-
                r = &header->prerequisites;
                if (!r->nr) {
                        printf_ln(_("The bundle records a complete history."));
@@ -282,6 +277,10 @@ int verify_bundle(struct repository *r,
                                  (uintmax_t)r->nr);
                        list_refs(r, 0, NULL);
                }
+
+               if (header->filter.choice)
+                       printf_ln("The bundle uses this filter: %s",
+                                 list_objects_filter_spec(&header->filter));
        }
        return ret;
 }
index ed95d195427114f61759ce27b677ee2dfbf15e70..c4ab1367afca3473c085baac19b8645dfd1d2278 100755 (executable)
@@ -510,8 +510,8 @@ do
                <TAG-2> refs/tags/v2
                <TAG-3> refs/tags/v3
                <COMMIT-P> HEAD
-               The bundle uses this filter: $filter
                The bundle records a complete history.
+               The bundle uses this filter: $filter
                EOF
                test_cmp expect actual &&