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

Re: [PATCH] config: fix case sensitive subsection names on writing

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 28, 2018, 01:01 UTC
Message-ID
<xmqqlg9wjhq7.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180727233606.179965-1-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
> A use reported a submodule issue regarding strange case indentation
s/use/&r/;  Is this "indentation" issue?
> issues, but it could be boiled down to the following test case:
> ...
Show 13 quoted lines
> +test_expect_success 'old-fashioned settings are case insensitive' '
> +	test_when_finished "rm -f testConfig testConfig_expect testConfig_actual" &&
> +
> +	cat >testConfig <<-EOF &&
> +		# insensitive:
> +		[V.A]
> +		r = value1
> +	EOF
> +	q_to_tab >testConfig_expect <<-EOF &&
> +		# insensitive:
> +		[V.A]
> +		Qr = value2
> +	EOF

It is unfortunate that we hardcode the exact indentation in the test to make it care. Perhaps a wrapper around test_cmp that is used locally in this file to first strip the leading HT from both sides of the comparison would make it more robust?

Show 7 quoted lines
> +	for key in "v.a.r" "V.A.r" "v.A.r" "V.a.r"
> +	do
> +		cp testConfig testConfig_actual &&
> +		git config -f testConfig_actual v.a.r value2 &&
> +		test_cmp testConfig_expect testConfig_actual
> +	done
> +'
I think you meant to use "$key" when setting the variable to value2.

When the test_cmp fails with "v.a.r" but later succeeds and most importantly succeeds with "V.a.r" (i.e. the last one), wouldn't the whole thing suceed? I think the common trick people use is to end the last one with "|| return 1" in a loop inside test_expect_success.

Previous: Stefan BellerNext: Stefan Beller
Message 7 of 33 in “config: fix case sensitive subsection names on writing”
  1. config: fix case sensitive subsection names on writingStefan Beller, Jul 27, 2018
  2. Brandon WilliamsJul 27, 2018
  3. Junio C HamanoJul 27, 2018
  4. Stefan BellerJul 27, 2018
  5. config: fix case sensitive subsection names on writingStefan Beller, Jul 27, 2018
  6. Stefan BellerJul 27, 2018
  7. Junio C HamanoJul 28, 2018
  8. Stefan BellerJul 28, 2018
  9. Jeff KingJul 28, 2018
  10. Junio C HamanoJul 28, 2018
  11. Johannes SchindelinJul 30, 2018
  12. 0/3 config: fix case sensitive subsection names on writingStefan Beller, Jul 30, 2018
  13. 1/3 t1300: document current behavior of setting optionsStefan Beller, Jul 30, 2018
  14. 2/3 config: fix case sensitive subsection names on writingStefan Beller, Jul 30, 2018
  15. Junio C HamanoJul 31, 2018
  16. 3/3 config: treat section case insensitive in store_aux_eventStefan Beller, Jul 30, 2018
  17. Junio C HamanoJul 31, 2018
  18. 0/3 sb/config-write-fix done without robbing PeterStefan Beller, Aug 1, 2018
  19. 1/3 t1300: document current behavior of setting optionsStefan Beller, Aug 1, 2018
  20. 2/3 config: fix case sensitive subsection names on writingStefan Beller, Aug 1, 2018
  21. Ramsay JonesAug 1, 2018
  22. Junio C HamanoAug 1, 2018
  23. Junio C HamanoAug 1, 2018
  24. Stefan BellerAug 3, 2018
  25. Junio C HamanoAug 3, 2018
  26. 3/3 git-config: document accidental multi-line setting in deprecated syntaxStefan Beller, Aug 1, 2018
  27. Eric SunshineAug 1, 2018
  28. Junio C HamanoAug 2, 2018
  29. 0/3 Reroll of sb/config-write-fixStefan Beller, Aug 3, 2018
  30. 1/3 t1300: document current behavior of setting optionsStefan Beller, Aug 3, 2018
  31. 2/3 config: fix case sensitive subsection names on writingStefan Beller, Aug 3, 2018
  32. 3/3 git-config: document accidental multi-line setting in deprecated syntaxStefan Beller, Aug 3, 2018
  33. Junio C HamanoJul 27, 2018

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.