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

Re: [PATCH 2/4] t4011: illustrate "diff-index -p" on stat-dirty paths

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 1, 2012, 16:10 UTC
Message-ID
<7v4nu8pai8.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4F4F49FD.3090504@in.waw.pl>
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:
Show 10 quoted lines
> On 03/01/2012 03:14 AM, Junio C Hamano wrote:
>> -test_expect_success SYMLINKS 'diff unchanged symlink'  '
>> +test_expect_success SYMLINKS 'diff unchanged symlink and file'  '
>>   	tree=$(git write-tree)&&
>> -	git update-index frotz&&
>> +	git update-index frotz nitfol&&
>>   	test -z "$(git diff-index --name-only $tree)"
>>   '
> why modify and extend an existing test instead of adding a new
> separate one?

If you are talking about assigning a new test number for a new script, it is better to avoid it when you can. If on the other hand you meant to add a new "test_expect_success" block, yes, that is one of the right things to consider when adding tests, and I tried it both ways.

The result was easier to read when done the way it was posted.

For this update, you could keep the later test that originally checked symlink intact and add an identical check for regular file, but the thing is, the behaviour change brought by the update in this series affect both symlink and regular file comes from the same underlying mechanism, and demonstrating the change in a single hunk that makes two phantom output lines disappear was far easier to review than two hunks each of which shows one phantom output line disapper.

Previous: Zbigniew Jędrzejewski-SzmekNext: Junio C Hamano
Message 8 of 10 in “"diff -p" patch header generation updates”
  1. 0/4 "diff -p" patch header generation updatesJunio C Hamano, Mar 1, 2012
  2. 1/4 t4011: modernise styleJunio C Hamano, Mar 1, 2012
  3. 2/4 t4011: illustrate "diff-index -p" on stat-dirty pathsJunio C Hamano, Mar 1, 2012
  4. Thomas RastMar 1, 2012
  5. Junio C HamanoMar 1, 2012
  6. 2/4 t4011: illustrate "diff-index -p" on stat-dirty pathsJunio C Hamano, Mar 1, 2012
  7. Zbigniew Jędrzejewski-SzmekMar 1, 2012
  8. Junio C HamanoMar 1, 2012
  9. 3/4 diff -p: squelch "diff --git" header for stat-dirty pathsJunio C Hamano, Mar 1, 2012
  10. 4/4 diff --ignore-mode-changeJunio C Hamano, Mar 1, 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.