From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.159 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796071756; b=0SkolEvNb3HSIHlz6S0oZmlnmESWEegM52exwEc3RIDot9IYXqsvnUMxYOygLbuMC9ib qI98eOnXQA2ngTxZ1/5yHqSja7hzR4JBnnZJjPxP86O2xcHWBsKPoueGCv7zTkwB98qpF rghjp0GOSzmSnsUiRpueRFq4RTCjSuPB0Q2XjwmiOCDoTsChmAE8U3u6PyP0YZuZn+7Kg Azm+HzwS2wXGa+nyyzWiMFOcaIZXXiYZykknCRph2xZEGWpVeAmpRcnP7aZyW9atFXxRv rc9bsQzQifn+1MlBbhDuJrewM2xcQV+8i/FfwTlTGPHggUd7nfoFiCuo1HlXmHWxaZA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796071756; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding; bh=n/an/7meIH4O8n1rN8Qj9OwanFG1XgS/J2LH9KvsLMU=; b=ZnxQMNxMblvKSbMrXHsl4D6TXz9vdNfLBne0bEDU1j34TPU/bWo/SdjeDcmw0xzfmBLZ qCO0JBwQjASGhM0Ec/2Hnt4SL4pjU6jauVIdKvGr47QC+9K7kJR2gFB1wVloYJFNXN98I DEQYr3Yk8Qgf0iCeapCofa+Wt8W6u0OIjytTPCLr8lSCol6I5oHIi9IhR++J1p/4YllDn RLRlnj/rT1JOPQZXTQH8MOA3g6VxZSH2IdKtXAEgvgyM5+SR0NeSHovKJ7RFRr78GyL4U 1c9vQrDpItmlhq3odARroFieFBhBawe8nMo77TugQHPPZD8ssdik9jotgvWrIUnq7kw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=fastmail.com; spf=pass smtp.mailfrom=fastmail.com; dkim=pass header.d=fastmail.com header.i=@fastmail.com header.a=rsa-sha256 header.s=fm3 header.b=lD2YIMtk; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=VIn3PRF9; arc=none smtp.remote-ip=103.168.172.159 Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65A63606A31A for ; Mon, 30 Nov 2026 20:49:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 65A63606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=fastmail.com header.i=@fastmail.com header.a=rsa-sha256 header.s=fm3 header.b=lD2YIMtk; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=VIn3PRF9 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 8EBB714008F2 for ; Mon, 30 Nov 2026 15:49:14 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Mon, 30 Nov 2026 15:49:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1796071754; x= 1796158154; bh=n/an/7meIH4O8n1rN8Qj9OwanFG1XgS/J2LH9KvsLMU=; b=l D2YIMtklnTVtH43lOlbdANeAqw72TXriRO7jIFJvR/0k9fRPNDf3Kduel+RJKzUR Q4pTBrpYhCKMNv9XC/NtDp5fPXtnMb3S64YipHbaC1JFY5EcS0gFR/N1LPnaLBrr an03Ac8RPffbj9Qo/AW/9PmvVd0TEf3eAfw90k2DugQXkc+BZ6fbmhYQVRMpIDXX CEdzyvPyXL9veS1ndBLelWWUh+pkH+DOMfklxhWXrBxrffdzA9y0ecry39dy5iOu E9TSBcsg+xXQzvCLzfJ03NCz1Du/CHsCJig3qQ8ndx3yphJTt3YZVa/1OoBfHqbP h6hWwWkIe0otGlyLefuSQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1796071754; x=1796158154; bh=n /an/7meIH4O8n1rN8Qj9OwanFG1XgS/J2LH9KvsLMU=; b=VIn3PRF9SVZCq/ea+ dMZ6Gz17PPe50EeSspXkDS9EftDJOtaUgPEF2EOklwUKf1gGg0nrKJdaFmFuPN7t mNx+lLqyb2+f95D4eO1d/CYGbgKT0zE8ld7TrpT7F/9vYqEClDoEoskw24/YCUme iTkMycoFIkdzGPbrJ5YfZF3uRQIb3I2D7e0QQotDS4UTWu37KYmOUmt4Tcjpxk02 i+fsBCz+9AjIsP0VTmH8XChMb3FJol2pWKOiR+Pwloc4j44aJCBvvAELl5wwcZ0R qGbgXbqEDbpf8kQYs8rKtrXliLx+Z5Qn0kFp/WKsRmXcEEFs3dQ6wCSZcekN7U/S W1w6w== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=fastmail.com a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796071754; d=fastmail.com; mf=PG1hcmtjaHVjYXJyb2xsQGZhc3RtYWlsLmNvbT4=; rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+; s=fm3:rsa-sha256:T/DJKHNHRiYWhoBk/J9qW3EA6EPMjn29zIaDc4QQB4kN5kq w/y9VeRbp1CAIgTmhhIjLFHghFW9SEv0O81m9ovJEOgbp+alPaOKZPvgzNxdxVS+ xMb1HB3NPw0g0BR0wbIP8r8sWPYFCsdLugEYkefxUwK0tNO1B+TDXRLiAtwTOEbW UXg+o3XHV/aqP3PysdmTrQnG0w3EOj98cjyLRCYiDxkJKOTsuz3EB9NPhCuCgOhG 0QmbaF2AJFRq7mX95HhRFGX0NxK5gOvCZDbUK2ibcMzFoFw6nFUQgKgZlLrboC1D aV7mpjYx2TmghzYIXAFXrT7Wpcfmk2a8ZQfUxLg==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=11; hn=cc,content-transfer-encoding,date,feedback-id,from, in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:26nOGGCxnoLA8gQo3IeNtkw4dBSZ90M9JZJHcDYTz6g=:WPdXV0yxmpEgz3o7NnCkfMmg/NaPBecNlil3Mr8HHm8=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFXJqN7lWcENwAmYECVS4LEXugiPrvdW/jtKv7Rw3xPn3pYnrSxUF7T245wDC4f8+ xqryIDrZ3fwf0/64JXxlIWSyo6hb5bpL9bdNafH92zmWFSxRn/DMOUSQ6v3uQANNxAtOOw UBFMfGi1vzEZeI6APy2Fsf/dq/qGhXgEGKVK6U14Q7lt4mQ6SMj0tCZeiiRfd/n7WY1kmd RWtlSaPDDQo6tvi3v48PkKbzxtMFxzFXIP4tePIGHWuIjKZ+BV4RQfpDOsqZLPND78+lO7 1wE02GXVXZ4AE54q2dOG+LXdeKVQXC+UDCyAC6eKzzFqJOiWnxXJcDw/Is5aHtQTMSeRj6 AvyUw+8A0EW5OQwFtmTkVkihUOnRTWhtXWCqXuy3QV/e1+UXOHomA1Ua0v1HwfaXmIPKlS wVi95wksy1BiWvPTqX7iO2NLe0TxNKYeYExKnQh3GUFWBYdRXjs6CtiNqBFu/fMQ4aIGnc xnAN8a4qOIrw7xiA/kw9HVDjGbhI9GJwxnuwaLvATazD58vdIV0fjKY3RwZxcYx5u99zCp RCMtoUdt4qBGcjPaL2GnTSwx7ez6uSaovm6hk7lLdvHlSxGdcKeZzFz1Jbvqzz3AFTeLIv +LUJoH69hZYav0Bpx4mctU0rFMUeLeNzviEJQtH89E0vUPxz5BMPG1SE0FwQ X-ME-Proxy: Feedback-ID: id2564aa6:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 30 Nov 2026 15:49:14 -0500 (EST) From: "Mark C. Chu-Carroll" To: gitster@pobox.com, git@vger.kernel.org Cc: jltobler@gmail.com, ps@pks.im, "Mark C. Chu-Carroll" Subject: [PATCH v9 1/1] repo: add filtering options to "repo structure" Date: Mon, 30 Nov 2026 15:49:12 -0500 Message-ID: <20261130204912.3538746-1-markchucarroll@fastmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261118203519.2379494-1-markchucarroll@fastmail.com> References: <20261118203519.2379494-1-markchucarroll@fastmail.com> X-Mailing-List: git@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The current implementation of "git repo stucture" provides summary information about everything in the repository - all of the branches, remotes, tags, stashes, and notes. But sometimes to properly diagnose a problem, it's useful to be able to filter this information to get focused data about the specific part of the repo that's exhibiting a problem. Update "git repo structure" to use rev expressions to filter the set of objects to be processed. This implementation makes an awkward trade-off involving "setup_revisions" which results in doing the ref-walk twice when revisions are specified on the command line. In order to accept the standard revs parameters, it uses `setup_revisions`, which does a ref walk and populates the pending objects list that will be used by "repo structure". But this ref walk doesn't count refs in the way that "repo structure" requires, and because "setup_revisions" doesn't support a custom callback for its ref-walk, that's not changeable. So in the cases where a user specifies revs, "repo structure" does an initial ref-walk as part of "setup_revisions", and then a second ref-walk in "count_references" in repo.c to count by reference type. Further, if the user doesn't specify a revs parameter, "setup_revisions" is not called, so the "count_references" walk needs to add objects to the pending list. A parameter is added to "count_references" to allow it to distinguish the cases where the pending list is already populated from the case where it needs to populate it. Signed-off-by: Mark C. Chu-Carroll --- Documentation/git-repo.adoc | 31 +++++- builtin/repo.c | 35 +++++-- t/t1901-repo-structure.sh | 197 ++++++++++++++++++++++++++++++++++++ 3 files changed, 250 insertions(+), 13 deletions(-) diff --git a/Documentation/git-repo.adoc b/Documentation/git-repo.adoc index ed7d80c690..819202dc4e 100644 --- a/Documentation/git-repo.adoc +++ b/Documentation/git-repo.adoc @@ -10,7 +10,7 @@ SYNOPSIS [synopsis] git repo info [--format=(lines|nul) | -z] [--all | ...] git repo info --keys [--format=(lines|nul) | -z] -git repo structure [--format=(table|lines|nul) | -z] +git repo structure [--format=(table|lines|nul) | -z] [...] DESCRIPTION ----------- @@ -56,7 +56,7 @@ supported: `nul`::: Similar to `lines`, but using a _NUL_ character after each value. -`structure [--format=(table|lines|nul) | -z]`:: +`structure [--format=(table|lines|nul) | -z] [...]`:: Retrieve statistics about the current repository structure. The following kinds of information are reported: + @@ -66,6 +66,11 @@ supported: * Total disk size of reachable objects by type * Largest reachable objects in the repository by type + +The set of objects counted can be filtered by specifying a collection +of revisions to select which objects will be counted. These parameters +follow the same syntax as the parameters to similar commands like +`git log`. Defaults to all objects reachable from a reference. ++ The output format can be chosen through the flag `--format`. Three formats are supported: + @@ -141,6 +146,28 @@ using the `nul` format: git repo info --format=nul layout.bare layout.shallow ------------ +* Generates information about storage usage in the repository: ++ +------------ +git repo structure +------------ ++ + +* Generates information about storage usage in the repository omitting +the branch "foo": ++ +------------ +git repo structure --all ^foo +------------ ++ +* Generates information about repository objects reachable from +the references "x" and "y", but omitting anything that can +only be reached on a path including "xchild": ++ +------------ +git repo structure x y ^xchild +------------ ++ SEE ALSO -------- linkgit:git-rev-parse[1] diff --git a/builtin/repo.c b/builtin/repo.c index 84e012f83f..ed032a3054 100644 --- a/builtin/repo.c +++ b/builtin/repo.c @@ -27,7 +27,7 @@ "git repo info --keys [--format=(lines|nul) | -z]" #define REPO_STRUCTURE_USAGE \ - "git repo structure [--format=(table|lines|nul) | -z]" + "git repo structure [--format=(table|lines|nul) | -z] [...]" static const char *const repo_usage[] = { REPO_INFO_USAGE, @@ -740,6 +740,7 @@ struct count_references_data { struct ref_stats *stats; struct rev_info *revs; struct progress *progress; + bool add_to_pending; }; static int count_references(const struct reference *ref, void *cb_data) @@ -766,10 +767,12 @@ static int count_references(const struct reference *ref, void *cb_data) } /* - * While iterating through references for counting, also add OIDs in + * While iterating through references for counting, if we didn't already + * populate the pending list in setup_revisions, also add OIDs in * preparation for the path walk. */ - add_pending_oid(data->revs, NULL, ref->oid, 0); + if (data->add_to_pending) + add_pending_oid(data->revs, NULL, ref->oid, 0); ref_count = get_total_reference_count(stats); display_progress(data->progress, ref_count); @@ -780,11 +783,13 @@ static int count_references(const struct reference *ref, void *cb_data) static void structure_count_references(struct ref_stats *stats, struct rev_info *revs, struct repository *repo, - int show_progress) + int show_progress, + bool add_to_pending) { struct count_references_data data = { .stats = stats, .revs = revs, + .add_to_pending = add_to_pending }; if (show_progress) @@ -935,6 +940,7 @@ static int cmd_repo_structure(int argc, const char **argv, const char *prefix, struct repo_structure stats = { 0 }; struct rev_info revs; int show_progress = -1; + bool included_revision_args = false; struct option options[] = { OPT_CALLBACK_F(0, "format", &format, N_("format"), N_("output format"), @@ -947,16 +953,23 @@ static int cmd_repo_structure(int argc, const char **argv, const char *prefix, OPT_END() }; - argc = parse_options(argc, argv, prefix, options, repo_structure_usage, 0); - if (argc) - usage(_("too many arguments")); - - repo_init_revisions(repo, &revs, prefix); - + argc = parse_options(argc, argv, prefix, options, repo_structure_usage, + PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN_OPT | + PARSE_OPT_KEEP_DASHDASH); if (show_progress < 0) show_progress = isatty(2); - structure_count_references(&stats.refs, &revs, repo, show_progress); + repo_init_revisions(repo, &revs, prefix); + if (argc > 1) { + argc = setup_revisions(argc, argv, &revs, NULL); + included_revision_args = revs.rev_input_given; + if (argc > 1) { + release_revisions(&revs); + return error(_("unrecognized argument: %s"), argv[1]); + } + } + + structure_count_references(&stats.refs, &revs, repo, show_progress, !included_revision_args); structure_count_objects(&stats.objects, &revs, repo, show_progress); switch (format) { diff --git a/t/t1901-repo-structure.sh b/t/t1901-repo-structure.sh index 02cc2b594a..e901023cb9 100755 --- a/t/t1901-repo-structure.sh +++ b/t/t1901-repo-structure.sh @@ -144,6 +144,203 @@ test_expect_success SHA1 'repository with references and objects' ' ) ' +test_expect_success SHA1 'repository with branches' ' + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && + test_commit_bulk 1005 && + git tag -a foo -m bar && + + oid="$(git rev-parse HEAD)" && + git update-ref refs/remotes/origin/foo "$oid" && + git checkout -b grobble && + test_commit_bulk --ref=refs/heads/grobble 20 && + git checkout master && + test_commit_bulk 20 && + # Also creates a commit, tree, and blob. + git notes add -m foo && + git repo structure --format=lines >actual 2>err && + test_grep "^objects" actual >actual.objects && + cat >expect <<-\EOF && + objects.commits.count=1046 + objects.trees.count=1006 + objects.blobs.count=1006 + objects.tags.count=1 + objects.commits.inflated_size=231976 + objects.trees.inflated_size=16578431 + objects.blobs.inflated_size=11962 + objects.tags.inflated_size=132 + objects.commits.disk_size=163722 + objects.trees.disk_size=284547 + objects.blobs.disk_size=21022 + objects.tags.disk_size=126 + objects.commits.max_size=223 + objects.commits.max_size_oid=0dc91eb18580102a3a216c8bfecedeba2b9f9b9a + objects.trees.max_size=33063 + objects.trees.max_size_oid=60665251ab71dbd8c18d9bf2174f4ee0d58aa06c + objects.blobs.max_size=13 + objects.blobs.max_size_oid=97d808e45116bf02103490294d3d46dad7a2ac62 + objects.tags.max_size=132 + objects.tags.max_size_oid=4dae4f5954f5e6feb3577cfb1b181daa3fd3afd2 + objects.commits.max_parents=1 + objects.commits.max_parents_oid=df6400c01440c329f1011669c4c26cc0c7852887 + objects.trees.max_entries=1005 + objects.trees.max_entries_oid=60665251ab71dbd8c18d9bf2174f4ee0d58aa06c + EOF + test_cmp expect actual.objects && + test_must_be_empty err + ) +' + +test_expect_success SHA1 'filter by a positive rev' ' + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && + test_commit_bulk 1005 && + git tag -a foo -m bar && + oid="$(git rev-parse HEAD)" && + git update-ref refs/remotes/origin/foo "$oid" && + git checkout -b grobble && + test_commit_bulk --ref=refs/heads/grobble 20 && + git checkout master && + test_commit_bulk 20 && + git notes add -m foo && + + cat >expect <<-\EOF && + objects.commits.count=1025 + objects.trees.count=1005 + objects.blobs.count=1005 + objects.tags.count=0 + objects.commits.inflated_size=227371 + objects.trees.inflated_size=16578363 + objects.blobs.inflated_size=11958 + objects.tags.inflated_size=0 + objects.commits.disk_size=160455 + objects.trees.disk_size=284462 + objects.blobs.disk_size=21003 + objects.tags.disk_size=0 + objects.commits.max_size=223 + objects.commits.max_size_oid=0dc91eb18580102a3a216c8bfecedeba2b9f9b9a + objects.trees.max_size=33063 + objects.trees.max_size_oid=60665251ab71dbd8c18d9bf2174f4ee0d58aa06c + objects.blobs.max_size=13 + objects.blobs.max_size_oid=97d808e45116bf02103490294d3d46dad7a2ac62 + objects.tags.max_size=0 + objects.tags.max_size_oid=0000000000000000000000000000000000000000 + objects.commits.max_parents=1 + objects.commits.max_parents_oid=c1d3cb6c863e93a546c657ccecdf0f643d2e18af + objects.trees.max_entries=1005 + objects.trees.max_entries_oid=60665251ab71dbd8c18d9bf2174f4ee0d58aa06c + EOF + git repo structure --format=lines grobble >actual 2>err && + test_grep "^objects" actual >actual.objects && + test_cmp expect actual.objects && + test_must_be_empty err + ) +' + +test_expect_success SHA1 'filter by both positive and negative revs' ' + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && + test_commit_bulk 1005 && + git tag -a foo -m bar && + + oid="$(git rev-parse HEAD)" && + git update-ref refs/remotes/origin/foo "$oid" && + git checkout -b grobble && + test_commit_bulk --ref=refs/heads/grobble 20 && + git checkout master && + test_commit_bulk 20 && + # Also creates a commit, tree, and blob. + git notes add -m foo && + + cat >expect <<-\EOF && + objects.commits.count=20 + objects.trees.count=1 + objects.blobs.count=1005 + objects.tags.count=0 + objects.commits.inflated_size=4411 + objects.trees.inflated_size=33063 + objects.blobs.inflated_size=11958 + objects.tags.inflated_size=0 + objects.commits.disk_size=3122 + objects.trees.disk_size=53 + objects.blobs.disk_size=21003 + objects.tags.disk_size=0 + objects.commits.max_size=221 + objects.commits.max_size_oid=c1d3cb6c863e93a546c657ccecdf0f643d2e18af + objects.trees.max_size=33063 + objects.trees.max_size_oid=60665251ab71dbd8c18d9bf2174f4ee0d58aa06c + objects.blobs.max_size=13 + objects.blobs.max_size_oid=97d808e45116bf02103490294d3d46dad7a2ac62 + objects.tags.max_size=0 + objects.tags.max_size_oid=0000000000000000000000000000000000000000 + objects.commits.max_parents=1 + objects.commits.max_parents_oid=c1d3cb6c863e93a546c657ccecdf0f643d2e18af + objects.trees.max_entries=1005 + objects.trees.max_entries_oid=60665251ab71dbd8c18d9bf2174f4ee0d58aa06c + EOF + git repo structure --format=lines grobble ^master >actual 2>err && + test_grep "^objects" actual >actual.objects && + test_cmp expect actual.objects && + test_must_be_empty err + ) +' + +test_expect_success SHA1 'filter by object type' ' + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && + test_commit_bulk 1005 && + git tag -a foo -m bar && + + oid="$(git rev-parse HEAD)" && + git update-ref refs/remotes/origin/foo "$oid" && + git checkout -b grobble && + test_commit_bulk --ref=refs/heads/grobble 20 && + git checkout master && + test_commit_bulk 20 && + # Also creates a commit, tree, and blob. + git notes add -m foo && + + cat >expect <<-\EOF && + objects.commits.count=0 + objects.trees.count=0 + objects.blobs.count=1006 + objects.tags.count=0 + objects.commits.inflated_size=0 + objects.trees.inflated_size=0 + objects.blobs.inflated_size=11962 + objects.tags.inflated_size=0 + objects.commits.disk_size=0 + objects.trees.disk_size=0 + objects.blobs.disk_size=21022 + objects.tags.disk_size=0 + objects.commits.max_size=0 + objects.commits.max_size_oid=0000000000000000000000000000000000000000 + objects.trees.max_size=0 + objects.trees.max_size_oid=0000000000000000000000000000000000000000 + objects.blobs.max_size=13 + objects.blobs.max_size_oid=97d808e45116bf02103490294d3d46dad7a2ac62 + objects.tags.max_size=0 + objects.tags.max_size_oid=0000000000000000000000000000000000000000 + objects.commits.max_parents=0 + objects.commits.max_parents_oid=0000000000000000000000000000000000000000 + objects.trees.max_entries=0 + objects.trees.max_entries_oid=0000000000000000000000000000000000000000 + EOF + git repo structure --format=lines --objects --all --filter=object:type=blob >actual 2>err && + test_grep "^objects" actual >actual.objects && + test_cmp expect actual.objects && + test_must_be_empty err + ) +' + test_expect_success SHA1 'lines and nul format' ' test_when_finished "rm -rf repo" && git init repo && -- 2.53.0