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

Re: [BUG] git commit --trailer --verbose puts trailer below scissors line

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 19, 2024, 18:42 UTC
Message-ID
<xmqqfrxo9ty2.fsf@gitster.g>
In-Reply-To
<ca6a73d3-58b4-e65c-4a8f-e6ddb3e86902@gmail.com>
Philippe Blain <levraiphilippeblain@gmail.com> writes:
Show 35 quoted lines
> Hi Peff,
>> ...
>> diff --git a/t/t7502-commit-porcelain.sh b/t/t7502-commit-porcelain.sh
>> index b5bf7de7cd..d8e216613f 100755
>> --- a/t/t7502-commit-porcelain.sh
>> +++ b/t/t7502-commit-porcelain.sh
>> @@ -485,6 +485,24 @@ test_expect_success 'commit --trailer not confused by --- separator' '
>>  	test_cmp expected actual
>>  '
>>  
>> +test_expect_success 'commit --trailer with --verbose' '
>> +	cat >msg <<-\EOF &&
>> +	subject
>> +
>> +	body
>> +	EOF
>> +	GIT_EDITOR=: git commit --edit -F msg --allow-empty \
>> +		--trailer="my-trailer: value" --verbose &&
>> +	{
>> +		cat msg &&
>> +		echo &&
>> +		echo "my-trailer: value"
>> +	} >expected &&
>> +	git cat-file commit HEAD >commit.msg &&
>> +	sed -e "1,/^\$/d" commit.msg >actual &&
>> +	test_cmp expected actual
>> +'
>> +
>>  test_expect_success 'multiple -m' '
>>  
>>  	>negative &&
>
> Thanks for the test case!
>
> Philippe.

Thanks, both, for finding a rather unfortunate regression. Perhaps it is worth delaying 2.44 final by a week or so to include a fix (or a revert if it comes to it).

Previous: Philippe BlainNext: Jeff King
Message 6 of 9 in “[BUG] git commit --trailer --verbose puts trailer below scissors line”
  1. Philippe BlainFeb 16, 2024
  2. Junio C HamanoFeb 16, 2024
  3. Linus ArverFeb 16, 2024
  4. Jeff KingFeb 17, 2024
  5. Philippe BlainFeb 19, 2024
  6. Junio C HamanoFeb 19, 2024
  7. trailer: fix comment/cut-line regression with opts->no_dividerJeff King, Feb 20, 2024
  8. Junio C HamanoFeb 20, 2024
  9. Linus ArverMar 8, 2024

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.