git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] repo: show subcommand-specific help text

From
Derrick Stolee <stolee@gmail.com>
Date
Mar 24, 2026, 17:07 UTC
Message-ID
<52a72fe5-d86d-4f06-bd08-5bbfd1faa78e@gmail.com>
In-Reply-To
<20260324122111.84122-1-mahlet.takassa@gmail.com>
On 3/24/2026 8:21 AM, Mahi Kassa wrote:
Show 8 quoted lines
> Use subcommand-specific usage arrays for "git repo info" and
> "git repo structure" so that each command shows only its own
> synopsis in help output.
> 
> Factor the shared usage strings into macros to avoid
> duplicating the same synopsis text in multiple arrays.
> 
> Add tests to cover the subcommand help behavior.
Missing sign-off.
Show 25 quoted lines
> @@ -148,5 +148,9 @@ test_expect_success 'git repo info --keys uses lines as its default output forma
>  	git repo info --keys >actual &&
>  	test_cmp expect actual
>  '
> -
> +test_expect_success 'git repo info -h shows only repo info usage' '
> +	test_must_fail git repo info -h >actual &&
> +	test_grep "git repo info" actual &&
> +	test_grep ! "git repo structure" actual
> +'
>  test_done
> diff --git a/t/t1901-repo-structure.sh b/t/t1901-repo-structure.sh
> index 98921ce1cb..0f7ec4da10 100755
> --- a/t/t1901-repo-structure.sh
> +++ b/t/t1901-repo-structure.sh
> @@ -224,4 +224,9 @@ test_expect_success 'progress meter option' '
>  	)
>  '
>  
> +test_expect_success 'git repo structure -h shows only repo structure usage' '
> +	test_must_fail git repo structure -h >actual &&
> +	test_grep "git repo structure" actual &&
> +	test_grep ! "git repo info" actual
> +'
>  test_done
Whitespace issues persist in these test files.

Thanks, -Stolee

Previous: Patrick SteinhardtNext: Mahi Kassa
Message 6 of 10 in “repo: show subcommand-specific help text”
  1. repo: show subcommand-specific help textMahi Kassa, Mar 23, 2026
  2. Derrick StoleeMar 23, 2026
  3. Patrick SteinhardtMar 24, 2026
  4. repo: show subcommand-specific help textMahi Kassa, Mar 24, 2026
  5. Patrick SteinhardtMar 24, 2026
  6. Derrick StoleeMar 24, 2026
  7. repo: show subcommand-specific help textMahi Kassa, Mar 24, 2026
  8. Derrick StoleeMar 24, 2026
  9. Patrick SteinhardtMar 25, 2026
  10. Junio C HamanoMar 25, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.