Re: [GSoC RFC PATCH v2 4/7] repo-info: add the --allow-empty flag
From: Karthik Nayak <hidden>
Date: 2025-06-20 09:54:23
Attachments
- signature.asc [application/pgp-signature] 690 bytes
From: Karthik Nayak <hidden>
Date: 2025-06-20 09:54:23
Lucas Seiki Oshiro [off-list ref] writes:
Add a flag --allow-empty, which will force the output data to be empty when no field is requested.
While you did reply to my previous question about this flag. This patch doesn't sell the need for it in anyway. So we need: 1. More description in the commit messages about why we need this flag and how it is useful. 2. Documentation around the same. I still think this is early for this, and we should add this flag later if the need arises. [snip]
diff --git a/t/t1900-repo-info.sh b/t/t1900-repo-info.sh index 998c835795..db4a6aad17 100755 --- a/t/t1900-repo-info.sh +++ b/t/t1900-repo-info.sh@@ -15,11 +15,12 @@ test_lazy_prereq PERLJSON ' ' test_expect_success PERLJSON 'json: returns empty output with allow-empty' ' - git repo-info --format=json >output && + git repo-info --allow-empty --format=json >output && test_line_count = 2 output ' + test_expect_success 'plaintext: returns empty output with allow-empty' ' - git repo-info --format=plaintext >output && + git repo-info --allow-empty --format=plaintext >output && test_line_count = 0 output '
The earlier patches reference allow-empty without really talking about it. Which feels odd and misplaced.