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

Re: [PATCH 1/4] test: modernize style of t4006

From
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Date
May 1, 2012, 19:55 UTC
Message-ID
<4FA03F9B.1020402@in.waw.pl>
In-Reply-To
<7vzk9r93ym.fsf@alter.siamese.dyndns.org>
On 05/01/2012 08:00 PM, Junio C Hamano wrote:
Show 11 quoted lines
> Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:
> 
>> Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
>> ---
>>  t/t4006-diff-mode.sh |   32 +++++++++++++++-----------------
>>  1 file changed, 15 insertions(+), 17 deletions(-)
> 
> Style update is welcome, but shouldn't the assignment to sed_script
> be done in the second test if it is the only user?  If you are going to
> add more tests at the end, then it should be away from the second test to
> make it clear that it is not part of it.

Hi, $sed_script is indeed only used in that one test. But moving the assignment inside would complicate the quoting rules (the script is now quoted with ', but this would have to change inside the test case which is quoted with ' too). I actually think it's simpler this way.

Thanks, Zbyszek

>> -sed -e 's/\(:100644 100755\) \('"$_x40"'\) \2 /\1 X X /' <current >check
>> -echo ":100644 100755 X X M	rezrov" >expected
>> +# $_x40 is defined in test-lib.sh
>> +sed_script='s/\(:100644 100755\) \('"$_x40"'\) \2 /\1 X X /'
Previous: Junio C HamanoNext: Zbigniew Jędrzejewski-Szmek
Message 4 of 11 in “report chmod'ed binary files the same as text files”
  1. 0/4 report chmod'ed binary files the same as text filesZbigniew Jędrzejewski-Szmek, May 1, 2012
  2. 1/4 test: modernize style of t4006Zbigniew Jędrzejewski-Szmek, May 1, 2012
  3. Junio C HamanoMay 1, 2012
  4. Zbigniew Jędrzejewski-SzmekMay 1, 2012
  5. 2/4 tests: check --[short]stat output after chmodZbigniew Jędrzejewski-Szmek, May 1, 2012
  6. Johannes SixtMay 2, 2012
  7. 3/4 diff --stat: report chmoded binary files like text filesZbigniew Jędrzejewski-Szmek, May 1, 2012
  8. Junio C HamanoMay 1, 2012
  9. Zbigniew Jędrzejewski-SzmekMay 1, 2012
  10. 4/4 diff --stat: do not run diff on indentical filesZbigniew Jędrzejewski-Szmek, May 1, 2012
  11. Martin MaresMay 3, 2012

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.