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

Re: [PATCH] pretty: fix ref filtering for %(decorate) formats

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 9, 2023, 18:24 UTC
Message-ID
<xmqq4jiz1woq.fsf@gitster.g>
In-Reply-To
<20231008202307.1568477-1-andy.koppe@gmail.com>
Andy Koppe <andy.koppe@gmail.com> writes:
> Mark pretty formats containing "%(decorate" as requiring decoration in
> userformat_find_requirements(), same as "%d" and "%D".
Ah, of course.  The patch makes sense.
Show 15 quoted lines
> diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
> index 16626e4fe9..5aabc9f7d8 100755
> --- a/t/t4205-log-pretty-formats.sh
> +++ b/t/t4205-log-pretty-formats.sh
> @@ -590,9 +590,9 @@ test_expect_success 'pretty format %decorate' '
>  	git log --format="%(decorate:prefix=,suffix=)" -1 >actual2 &&
>  	test_cmp expect2 actual2 &&
>  
> -	echo "[ HEAD -> foo; tag: bar; qux ]" >expect3 &&
> -	git log --format="%(decorate:prefix=[ ,suffix= ],separator=%x3B )" \
> -		-1 >actual3 &&
> +	echo "[ bar; qux; foo ]" >expect3 &&
> +	git log --format="%(decorate:prefix=[ ,suffix= ],separator=%x3B ,tag=)" \
> +		--decorate-refs=refs/ -1 >actual3 &&
>  	test_cmp expect3 actual3 &&

The original test shares the same, but is the order of multiple decorations expected to be stable? I feel a bit uneasy to see a test that insists multiple things come out in a hardcoded order.

It is not making anything _worse_, so let's take the patch as-is.
Thanks.
>  	# Try with a typo (in "separator"), in which case the placeholder should
Previous: Andy Koppe
Message 2 of 2 in “pretty: fix ref filtering for %(decorate) formats”
  1. pretty: fix ref filtering for %(decorate) formatsAndy Koppe, Oct 8, 2023
  2. Junio C HamanoOct 9, 2023

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.