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

Re: [PATCH v4 1/2] status: introduce status.short to enable --short by default

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 11, 2013, 21:38 UTC
Message-ID
<7v1u889vkj.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1370957645-17905-1-git-send-email-Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>
Jorge-Juan.Garcia-Garcia@ensimag.imag.fr writes:
Show 22 quoted lines
> diff --git a/t/t7508-status.sh b/t/t7508-status.sh
> index e2ffdac..3c0818b 100755
> --- a/t/t7508-status.sh
> +++ b/t/t7508-status.sh
> @@ -1335,4 +1335,39 @@ test_expect_failure '.git/config ignore=all suppresses submodule summary' '
>  	git config -f .gitmodules  --remove-section submodule.subname
>  '
>  
> +test_expect_success 'Setup of test environment' '
> +	git config status.showUntrackedFiles no
> +'
> +
> +test_expect_success '"status.short=true" same as "-s"' '
> +	git -c status.short=true status >actual &&
> +	git status -s >expected_short &&
> +	test_cmp expected_short actual
> +'
> +
> +test_expect_success '"status.short=true" different from "--no-short"' '
> +	git status --no-short >expected_noshort &&
> +	test_must_fail test_cmp expected_noshort actual
> +'

I am not sure if "must be different, and I do not care what kind of difference we get" is a good test.

Show 10 quoted lines
> +test_expect_success '"status.short=true" weaker than "--no-short"' '
> +	git -c status.short=true status --no-short >actual &&
> +	test_cmp expected_noshort actual
> +'
> +
> +test_expect_success '"status.short=false" same as "--no-short"' '
> +	git -c status.short=false status >actual &&
> +	git status -s >expected_short &&
> +	test_cmp expected_noshort actual
> +'
I think the second line in this test is unwanted.
Show 11 quoted lines
> +
> +test_expect_success '"status.short=false" weaker than "-s"' '
> +	git -c status.short=false status -s >actual &&
> +	test_cmp expected_short actual
> +'
> +
> +test_expect_success 'Restore default test environment' '
> +	git config --unset status.showUntrackedFiles
> +'
> +
>  test_done
I'll queue this patch after tweaking the test part like this.
Thanks.
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index e2ffdac..33cadd0 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -1335,4 +1335,34 @@ test_expect_failure '.git/config ignore=all suppresses submodule summary' '
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
+test_expect_success 'setup of test environment' '
+	git config status.showUntrackedFiles no &&
+	git status -s >expected_short &&
+	git status --no-short >expected_noshort
+'
+
+test_expect_success '"status.short=true" same as "-s"' '
+	git -c status.short=true status >actual &&
+	test_cmp expected_short actual
+'
+
+test_expect_success '"status.short=true" weaker than "--no-short"' '
+	git -c status.short=true status --no-short >actual &&
+	test_cmp expected_noshort actual
+'
+
+test_expect_success '"status.short=false" same as "--no-short"' '
+	git -c status.short=false status >actual &&
+	test_cmp expected_noshort actual
+'
+
+test_expect_success '"status.short=false" weaker than "-s"' '
+	git -c status.short=false status -s >actual &&
+	test_cmp expected_short actual
+'
+
+test_expect_success 'Restore default test environment' '
+	git config --unset status.showUntrackedFiles
+'
+
 test_done
Previous: Matthieu MoyNext: Matthieu Moy
Message 4 of 5 in “status: introduce status.short to enable --short by default”
  1. 1/2 status: introduce status.short to enable --short by defaultjorge-juan.garcia-garcia@ensimag.imag.fr, Jun 11, 2013
  2. 2/2 status:introduce status.branch to enable --branch by defaultjorge-juan.garcia-garcia@ensimag.imag.fr, Jun 11, 2013
  3. Matthieu MoyJun 11, 2013
  4. Junio C HamanoJun 11, 2013
  5. Matthieu MoyJun 12, 2013

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.