Re: [BUG?] "git config --replace-all key value value_regex" ignores value_regex?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Derrick Stolee <stolee@xxxxxxxxx> writes:

>>> test_expect_success '--replace-all and value_regex' '
>>> 	q_to_tab >.git/config <<-\EOF &&
>>> 	[abc]
>>> 	Qkey = one
>>> 	Qkey = two
>>> 	Qkey = three
>>> 	EOF
>>> 	q_to_tab >expect <<-\EOF &&
>>> 	[abc]
>>> 	Qkey = four
>>> 	Qkey = two
>>> 	Qkey = three
>>> 	EOF
>>> 	git config --replace-all abc.key four "o*" &&
>>> 	test_cmp expect .git/config
>>> '
>> ...
> Thank you. Naturally, PEBKAC and my lack of understanding the
> regex I was using in my own test. Clearly this is behaving
> correctly. Modifying as suggested shows this works properly.

It is an easy confusion.

When I see a pattern, especially a single letter followed by an
asterisk like "o*", my eyes take it as a glob pattern that is left
anchored, i.e. "any string that begins with an 'o'", and if that
were the matching rule, what you expected is totally the natural
outcome.  But here we unfortunately are looking at ERE.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux