Thread (178 messages) 178 messages, 10 authors, 2025-08-16

Re: [GSoC PATCH v9 3/5] repo: add the field layout.bare

From: Eric Sunshine <hidden>
Date: 2025-08-11 05:22:06

On Thu, Aug 7, 2025 at 11:04 AM Lucas Seiki Oshiro
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
This commit is part of the series that introduces the new subcommand
git-repo-info.

The flag --is-bare-repository from git-rev-parse is used for retrieving
whether the current repository is bare. This way, it is used for
querying repository metadata, fitting in the purpose of git-repo-info.

Then, add a new field layout.bare to the git-repo-info subcommand
containing that information.

Signed-off-by: Lucas Seiki Oshiro <redacted>
---
diff --git a/t/t1900-repo.sh b/t/t1900-repo.sh
@@ -54,4 +60,14 @@ test_expect_success 'only one value is returned if the same key is requested twi
+test_expect_success 'output is returned correctly when two keys are requested' '
+       cat >expected <<-\EOF &&
+       layout.bare=false
+       references.format=files
+       EOF
+       git init --ref-format=files two-keys &&
+       git -C two-keys repo info layout.bare references.format >actual &&
+       test_cmp expected actual
+'
Since the documentation asserts that the emitted key/value lines will
be sorted lexicographically, can we also have a test that verifies
that behavior? There are a couple ways you could do that: (1) either
add another test just like this one but reverse the order of the
arguments to the `git repo info` invocation, or (2) modify this test
by reversing the arguments and (*importantly*) add a comment to the
test body explaining that the order of the arguments to the command
invocation are intentionally different from the output to prove that
the output order is unrelated to the argument order.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help