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
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Date
Mar 1, 2012, 10:05 UTC
Message-ID
<4F4F49FD.3090504@in.waw.pl>
In-Reply-To
<1330568057-27304-3-git-send-email-gitster@pobox.com>
On 03/01/2012 03:14 AM, Junio C Hamano wrote:
Show 7 quoted lines
> -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)"
>   '

Hi, why modify and extend an existing test instead of adding a new separate one? I think the test-suite should be getting more unittest-y, ie. checking minimal aspects of functionality, not less.

Zbyszek
Show 22 quoted lines
> -test_expect_success SYMLINKS 'diff removed symlink' '
> +test_expect_success SYMLINKS 'diff removed symlink and file' '
>   	cat>expected<<-\EOF&&
>   	diff --git a/frotz b/frotz
>   	deleted file mode 120000
> @@ -44,22 +52,39 @@ test_expect_success SYMLINKS 'diff removed symlink' '
>   	@@ -1 +0,0 @@
>   	-xyzzy
>   	\ No newline at end of file
> +	diff --git a/nitfol b/nitfol
> +	deleted file mode 100644
> +	index 7c465af..0000000
> +	--- a/nitfol
> +	+++ /dev/null
> +	@@ -1 +0,0 @@
> +	-xyzzy
>   	EOF
>   	mv frotz frotz2&&
> +	mv nitfol nitfol2&&
>   	git diff-index -M -p $tree>current&&
>   	compare_diff_patch expected current
>   '
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 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.