From: "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, avarab@gmail.com,
Derrick Stolee <derrickstolee@github.com>,
Derrick Stolee <derrickstolee@github.com>
Subject: [PATCH 4/5] bundle: move capabilities to end of 'verify'
Date: Tue, 22 Mar 2022 17:28:38 +0000 [thread overview]
Message-ID: <1b2130426bd7bd6c0bf5c56be2bf66a4d81f0b27.1647970119.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1186.git.1647970119.gitgitgadget@gmail.com>
From: Derrick Stolee <derrickstolee@github.com>
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>
---
Documentation/git-bundle.txt | 10 +++++-----
bundle.c | 9 ++++-----
t/t6020-bundle-misc.sh | 2 +-
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt
index ac4c4352aae..7685b570455 100644
--- a/Documentation/git-bundle.txt
+++ b/Documentation/git-bundle.txt
@@ -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
diff --git a/bundle.c b/bundle.c
index e359370cfcd..276b55f8ce2 100644
--- 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;
}
diff --git a/t/t6020-bundle-misc.sh b/t/t6020-bundle-misc.sh
index ed95d195427..c4ab1367afc 100755
--- a/t/t6020-bundle-misc.sh
+++ b/t/t6020-bundle-misc.sh
@@ -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 &&
--
gitgitgadget
next prev parent reply other threads:[~2022-03-22 17:29 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-22 17:28 [PATCH 0/5] Partial bundle follow ups Derrick Stolee via GitGitGadget
2022-03-22 17:28 ` [PATCH 1/5] list-objects-filter: remove CL_ARG__FILTER Derrick Stolee via GitGitGadget
2022-03-22 17:28 ` [PATCH 2/5] pack-objects: move revs out of get_object_list() Derrick Stolee via GitGitGadget
2022-03-22 17:28 ` [PATCH 3/5] pack-objects: parse --filter directly into revs.filter Derrick Stolee via GitGitGadget
2022-03-22 19:37 ` [-SPAM-] " Ramsay Jones
2022-03-23 13:48 ` Derrick Stolee
2022-03-22 21:15 ` Ævar Arnfjörð Bjarmason
2022-03-22 17:28 ` Derrick Stolee via GitGitGadget [this message]
2022-03-23 7:08 ` [PATCH 4/5] bundle: move capabilities to end of 'verify' Bagas Sanjaya
2022-03-23 13:39 ` Derrick Stolee
2022-03-22 17:28 ` [PATCH 5/5] bundle: output hash information in 'verify' Derrick Stolee via GitGitGadget
2022-03-23 21:27 ` [PATCH 0/5] Partial bundle follow ups Junio C Hamano
2022-03-25 14:25 ` [PATCH] pack-objects: lazily set up "struct rev_info", don't leak Ævar Arnfjörð Bjarmason
2022-03-25 14:57 ` Derrick Stolee
2022-03-25 16:00 ` Ævar Arnfjörð Bjarmason
2022-03-25 16:41 ` Derrick Stolee
2022-03-25 17:34 ` Ævar Arnfjörð Bjarmason
2022-03-25 19:08 ` Derrick Stolee
2022-03-26 0:52 ` Ævar Arnfjörð Bjarmason
2022-03-28 14:04 ` Derrick Stolee
2022-03-25 18:53 ` Junio C Hamano
2022-03-26 1:09 ` Ævar Arnfjörð Bjarmason
2022-03-28 15:43 ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2022-03-28 15:58 ` Derrick Stolee
2022-03-28 17:10 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1b2130426bd7bd6c0bf5c56be2bf66a4d81f0b27.1647970119.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=avarab@gmail.com \
--cc=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).