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

Re: [PATCH 4/4] branch: add '--show-description' option

From
Johannes Sixt <j6t@kdbg.org>
Date
Jan 2, 2018, 09:32 UTC
Message-ID
<c3937260-1ffd-797b-7f25-53a6a4bf3676@kdbg.org>
In-Reply-To
<20180101225448.2561-5-szeder.dev@gmail.com>
Am 01.01.2018 um 23:54 schrieb SZEDER Gábor:
Show 16 quoted lines
> 'git branch' has an option to edit a branch's description, but lacks
> the option to show that description.
> 
> Therefore, add a new '--show-description' option to do just that, as a
> more user-friendly alternative to 'git config --get
> branch.$branchname.description':
> 
>    - it's shorter to type (both in the number of characters and the
>      number of TABs if using completion),
>    - works on the current branch without explicitly naming it,
>    - hides the implementation detail that branch descriptions are
>      stored in the config file, and
>    - errors out with a proper error message when the given branch
>      doesn't exist (but exits quietly with an error code when the
>      branch does exit but has no description, just like the 'git config'
>      query does).
Show 6 quoted lines
> +test_expect_success '--show-description with no description errors quietly' '
> +	git config --unset branch.master.description &&
> +	test_must_fail git branch --show-description >actual 2>actual.err &&
> +	test_must_be_empty actual &&
> +	test_must_be_empty actual.err
> +'

Checking the exact contents of stderr typically fails when tests are run under -x. Perhaps

	test_i18ngrep ! "fatal: " actual.err &&"
	test_i18ngrep ! "error: " actual.err &&
	test_i18ngrep ! "warning: " actual.err

Which makes me wonder: Why would --show-description have to error out silently? This is not 'git config' after all.

-- Hannes
Previous: SZEDER GáborNext: SZEDER Gábor
Message 6 of 10 in “branch: add '--show-description' option”
  1. 0/4 branch: add '--show-description' optionSZEDER Gábor, Jan 1, 2018
  2. 2/4 t3200: fix a misindented lineSZEDER Gábor, Jan 1, 2018
  3. 4/4 branch: add '--show-description' optionSZEDER Gábor, Jan 1, 2018
  4. Eric SunshineJan 2, 2018
  5. SZEDER GáborJan 2, 2018
  6. Johannes SixtJan 2, 2018
  7. SZEDER GáborJan 2, 2018
  8. SZEDER GáborJan 2, 2018
  9. 3/4 t3200: restore branch after "unborn --edit-description" testSZEDER Gábor, Jan 1, 2018
  10. 1/4 branch: '--edit-description' is incompatible with other optionsSZEDER Gábor, Jan 1, 2018

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.