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

Re: 195b7ca6 breaks t9010 at current master

From
BCBrandon Casey <brandon.casey.ctr@nrlssc.navy.mil>
Date
Mar 31, 2011, 16:11 UTC
Message-ID
<YHiIPkNCiU3RcX-PxtGuaAPfpIMSLtDzcuGX-pUHbb_4SC5aAQu_WQ@cipher.nrlssc.navy.mil>
In-Reply-To
<20110329042446.GB25693@elie>
[removed Junio from cc]
On 03/28/2011 11:24 PM, Jonathan Nieder wrote:
Show 42 quoted lines
> Hi,
> 
> Øyvind A. Holm wrote:
> 
>> When running "make test" at current master (v1.7.4.2-406-gbe919d5),
>> t9010-svn-fe.sh fails. Bisecting shows that 195b7ca6 ("vcs-svn: handle
>> log message with embedded NUL") breaks the test.
> 
> Could you try with the following patch applied?  It comes from
> squashing the last two patches from the svn-fe branch:
> 
> * tests: make sure input to sed is newline terminated
> * vcs-svn: add missing cast to printf argument
> 
> Sorry for the breakage.
> ---
> diff --git a/t/t9010-svn-fe.sh b/t/t9010-svn-fe.sh
> index 478c860..6f6175a 100755
> --- a/t/t9010-svn-fe.sh
> +++ b/t/t9010-svn-fe.sh
> @@ -407,7 +407,7 @@ test_expect_success 'NUL in log message, file content, and property name' '
>  	OBJID
>  	:000000 100644 OBJID OBJID A	greeting
>  	EOF
> -	printf "\n%s" "something with an ASCII NUL (Q)" >expect.message &&
> +	printf "\n%s\n" "something with an ASCII NUL (Q)" >expect.message &&
>  	printf "%s\n" "helQo" >expect.hello1 &&
>  	printf "%s\n" "link hello" >expect.hello2 &&
>  	{
> @@ -465,7 +465,11 @@ test_expect_success 'NUL in log message, file content, and property name' '
>  		git diff-tree --root --stdin |
>  		sed "s/$_x40/OBJID/g"
>  	} >actual &&
> -	git cat-file commit HEAD | nul_to_q | sed -ne "/^\$/,\$ p" >actual.message &&
> +	{
> +		git cat-file commit HEAD | nul_to_q &&
> +		echo
> +	} |
> +	sed -ne "/^\$/,\$ p" >actual.message &&
>  	git cat-file blob HEAD^:greeting | nul_to_q >actual.hello1 &&
>  	git cat-file blob HEAD:greeting | nul_to_q >actual.hello2 &&
>  	test_cmp expect actual &&

I was just about to send a patch for this, when I noticed it has already been worked around in master by the above.

I'll still share my one-liner for informational purposes which uses perl and in my opinion is a little simpler:

diff --git a/t/t9010-svn-fe.sh b/t/t9010-svn-fe.sh
index 478c860..0dcffaa 100755
--- a/t/t9010-svn-fe.sh
+++ b/t/t9010-svn-fe.sh
@@ -465,7 +465,7 @@ test_expect_success 'NUL in log message, file content, and property name' '
                git diff-tree --root --stdin |
                sed "s/$_x40/OBJID/g"
        } >actual &&
-       git cat-file commit HEAD | nul_to_q | sed -ne "/^\$/,\$ p" >actual.message &&
+       git cat-file commit HEAD | nul_to_q | perl -ne "print if (/^$/..eof())" >actual.message &&
        git cat-file blob HEAD^:greeting | nul_to_q >actual.hello1 &&
        git cat-file blob HEAD:greeting | nul_to_q >actual.hello2 &&
        test_cmp expect actual &&

-Brandon
Previous: Øyvind A. HolmNext: Jonathan Nieder
Message 6 of 7 in “195b7ca6 breaks t9010 at current master”
  1. Øyvind A. HolmMar 29, 2011
  2. Jonathan NiederMar 29, 2011
  3. Brian GernhardtMar 29, 2011
  4. [PULL svn-fe] Re: 195b7ca6 breaks t9010 at current masterJonathan Nieder, Mar 29, 2011
  5. Øyvind A. HolmMar 29, 2011
  6. Brandon CaseyMar 31, 2011
  7. Jonathan NiederMar 31, 2011

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.