{"thread":{"id":"39112","subject":"Why does \"git log --author=<pattern>\" not work with \"regexp-ignore-case\" and other regexp-related options?","startedAt":"2015-04-19T08:29:41Z","lastAt":"2015-04-20T05:59:19Z","messageCount":2,"participants":["Tim Friske","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"259640","messageId":"55336775.2020000@tifr.de","threadId":"39112","inReplyTo":null,"subject":"Why does \"git log --author=<pattern>\" not work with \"regexp-ignore-case\" and other regexp-related options?","fromName":"Tim Friske","fromEmail":"me@tifr.de","sentAt":"2015-04-19T08:29:41Z","receivedAt":"2015-04-19T08:29:41Z","isPatch":false,"sender":{"key":"me@tifr.de","avatar":null},"body":"Hi,\n\nI wonder why \"git log --author=<pattern>\" does not work with the\n\"regexp-ignore-case\" option and the other regexp-related options?\nWouldn't it be useful to make the \"author=<pattern>\" option support the\nfollowing options?\n\n  * basic-regexp\n  * extended-regexp\n  * fixed-strings\n  * perl-regexp\n\nIn the same way \"git log --committer=<pattern>\" cannot be combined with\nany of the above options.\n\nI tried to find out which regexp dialect to use for the \"<pattern>\"\nargument that must be passed to the \"author\" and \"committer\" options but\nwithout luck. The git-log(1) manual page just states for these options\n\"... that match the specified pattern (regular expression)\".\n\nGiven a commit with the following headers:\n\nAuthor: Tim Friske <me@tifr.de>\nCommit: Tim Friske <me@tifr.de>\n\nWhen running \"git log --author='tim|friske' --regexp-ignore-case\" I\nwould expect a match because lower- and upper case characters are\ntreated as equal.\n\nWhen running \"git --log --author='Tim|Friske' --fixed-strings\" I would\nexpect *no* match because the string 'Tim|Friske' should be taken\nliterally and not be interpreted as a pattern.\n\nWhen running \"git --log --author='Tim|Friske' --basic-regexp\" I would\nexpect *no* match because basic regular expression syntax does not\nsupport \"|\" alternation.\n\nWouldn't it be nice to have all of the above options collaborate with\neach other?\n\nBR\nTim\n"},{"id":"259661","messageId":"xmqqoamjmjbc.fsf@gitster.dls.corp.google.com","threadId":"39112","inReplyTo":"55336775.2020000@tifr.de","subject":"Re: Why does \"git log --author=<pattern>\" not work with \"regexp-ignore-case\" and other regexp-related options?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-04-20T05:59:19Z","receivedAt":"2015-04-20T05:59:19Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Tim Friske <me@tifr.de> writes:\n\n> I wonder why \"git log --author=<pattern>\" does not work with the\n> \"regexp-ignore-case\" option and the other regexp-related options\n> Wouldn't it be useful to make ...\n\nI think the reason is because nobody bothered to make it so.  That\ndoes not necessarily say what you suggest is not useful, but if it\nwere so very much useful in the real world, perhaps somebody may\nhave already been motivated enough to make it so, and the fact that\nit has not happened might be an indirect indication of its predicted\nusefulness.  I dunno.\n\nIn any case, I do not offhand see how it would _hurt_ if we added\nsuch a feature.  The only reason it may hurt existing users would be\nthat people may depend on the current behaviour, trusting that\nexactly spelling --author=Tim option, when using case-ignoring\nmatching of --grep=<pattern> to find the <pattern> in the log string\nfilters out the other tim whose name is spelled with lowercase.\nYour proposed new world order _will_ break such users.  But I do not\nthink it is very likely to become a real-world issue.\n\nOf course, if the implementation is done poorly, it _will_ hurt the\noverall performance or maintainability and that would make such an\nimplementation unacceptable, but that is a separate matter---it does\nnot reject the feature, just a specific poor implementation.\n\nSo a patch to do so cleanly with proper tests is very much welcomed.\n\nThe same comment applies to your other \"wouldn't it be wonderful if\n-G<pattern> became case-insensitive with an option?\" topic (but as I\nalready said, -S<string> is *not* -G<string> with --fixed-strings).\n\nThanks.\n"}]}