Re: git-prompt.sh incompatible with non-basic global grep.patternType
- From
Jeff King <peff@peff.net>
- Date
- Jul 20, 2016, 20:52 UTC
- Message-ID
- <20160720205207.GA578@sigill.intra.peff.net>
- In-Reply-To
- <xmqqwpkgcbp9.fsf@gitster.mtv.corp.google.com>
On Wed, Jul 20, 2016 at 01:10:42PM -0700, Junio C Hamano wrote:
Show 15 quoted lines
> This may fix it. I think the root cause is that logic to smear > "pattern type" into various broken-down fields in grep_opt for the > short-hands like --basic-regexp option needs to leave "I am setting > this short-hand" mark to allow the grep_commit_pattern_type() that > is done as the final step of the set-up sequence before we call > compile_grep_patterns() can take notice. The calls currently made > to grep_set_pattern_type_option() when we parse "--basic-regexp" and > friends forgets to override the "source of truth" field and only > updates the broken-down fields. > > An alternative may be to update places that parse "--basic-regexp" > and friends to just write to .pattern_type_option without calling > grep_set_pattern_type_option(); that might be a cleaner, but I am > not feeling well today so I won't be able to do a deeper analysis > right now.
I gave a very cursory look when I wrote the other email, and your alternative solution is what looked like the most elegant fix to me.
I suspect this bug has been there quite a while, so no rush. :)
-Peff