{"thread":{"id":"9132","subject":"[PATCH] Added 'git-rev-list --igrep' option for case insensitive grep","startedAt":"2007-07-22T05:33:47Z","lastAt":"2007-07-22T07:52:12Z","messageCount":4,"participants":["Dmitry Kakurin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"48091","messageId":"a1bbc6950707212233h6047ecfas645b71b9b4c6317e@mail.gmail.com","threadId":"9132","inReplyTo":null,"subject":"[PATCH] Added 'git-rev-list --igrep' option for case insensitive grep","fromName":"Dmitry Kakurin","fromEmail":"dmitry.kakurin@gmail.com","sentAt":"2007-07-22T05:33:47Z","receivedAt":"2007-07-22T05:33:47Z","isPatch":true,"sender":{"key":"dmitry.kakurin@gmail.com","avatar":null},"body":">From 4b16e1823875f0051e3f0590803ab67dd3ca341d Mon Sep 17 00:00:00 2001\nFrom: Dmitry Kakurin <Dmitry.Kakurin@gmail.com>\nDate: Sat, 21 Jul 2007 22:22:49 -0700\nSubject: [PATCH] Added 'git-rev-list --igrep' option for case insensitive grep\n\n---\n Documentation/git-rev-list.txt |    6 +++++-\n revision.c                     |    5 +++++\n 2 files changed, 10 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt\nindex 08e7573..f427862 100644\n--- a/Documentation/git-rev-list.txt\n+++ b/Documentation/git-rev-list.txt\n@@ -26,7 +26,7 @@ SYNOPSIS\n \t     [ \\--left-right ]\n \t     [ \\--cherry-pick ]\n \t     [ \\--encoding[=<encoding>] ]\n-\t     [ \\--(author|committer|grep)=<pattern> ]\n+\t     [ \\--(author|committer|grep|igrep)=<pattern> ]\n \t     [ \\--regexp-ignore-case ] [ \\--extended-regexp ]\n \t     [ \\--date={local|relative|default|iso|rfc|short} ]\n \t     [ [\\--objects | \\--objects-edge] [ \\--unpacked ] ]\n@@ -227,6 +227,10 @@ limiting may be applied.\n \tLimit the commits output to ones with log message that\n \tmatches the specified pattern (regular expression).\n\n+--igrep='pattern'::\n+\n+\tEquivalent to --grep='pattern' --regexp-ignore-case.\n+\n --regexp-ignore-case::\n\n \tMatch the regexp limiting patterns without regard to letters case.\ndiff --git a/revision.c b/revision.c\nindex 28b5f2e..d5e1e69 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -1165,6 +1165,11 @@ int setup_revisions(int argc, const char\n**argv, struct rev_info *revs, const ch\n \t\t\t\tadd_message_grep(revs, arg+7);\n \t\t\t\tcontinue;\n \t\t\t}\n+\t\t\tif (!prefixcmp(arg, \"--igrep=\")) {\n+\t\t\t\tadd_message_grep(revs, arg+8);\n+\t\t\t\tregflags |= REG_ICASE;\n+\t\t\t\tcontinue;\n+\t\t\t}\n \t\t\tif (!prefixcmp(arg, \"--extended-regexp\")) {\n \t\t\t\tregflags |= REG_EXTENDED;\n \t\t\t\tcontinue;\n-- \n1.5.2.3\n"},{"id":"48092","messageId":"7v8x99t25s.fsf@assigned-by-dhcp.cox.net","threadId":"9132","inReplyTo":"a1bbc6950707212233h6047ecfas645b71b9b4c6317e@mail.gmail.com","subject":"Re: [PATCH] Added 'git-rev-list --igrep' option for case insensitive grep","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-22T05:53:19Z","receivedAt":"2007-07-22T05:53:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Are there notable side effects you would need to warn users\nabout?\n\nFor example, what is the difference between \"--igrep=foo\n--author=bar\" and \"--grep=foo --author=bar\"?\n"},{"id":"48094","messageId":"7vwswtrmhe.fsf@assigned-by-dhcp.cox.net","threadId":"9132","inReplyTo":"7v8x99t25s.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Added 'git-rev-list --igrep' option for case insensitive grep","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-22T06:17:17Z","receivedAt":"2007-07-22T06:17:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Are there notable side effects you would need to warn users\n> about?\n>\n> For example, what is the difference between \"--igrep=foo\n> --author=bar\" and \"--grep=foo --author=bar\"?\n\nNah, let's not try to be too subtle.  It does not work.\n\nWhat I am wondering is if there is an unintended option name\nconflict if we simply accept \"-i\" and \"-E\" as synonyms to\n\"--regexp-ignore-case\" and \"--extended-regexp\".  The option\nparser for log family in revision.c is used from many places,\nso it is a bit hard to verify everobody to be absolutely sure,\nbut I do not think of any offhand.  There indeed are commands\nthat take \"-i\" to mean something other than ignore-case, but\nignore-case would not be meaningful for their operation.\n\nSo I would rather prefer this replacement patch.\n\n-- >8 --\nSynonyms: -i == --regexp-ignore-case, -E == --extended-regexp\n\nThese options to log family were too long to type.  Give them\nshorter synonyms.\n\nFix the parsing of the long options while at it.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/git-rev-list.txt |    7 ++++---\n revision.c                     |    6 ++++--\n 2 files changed, 8 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt\nindex 08e7573..f9fadaf 100644\n--- a/Documentation/git-rev-list.txt\n+++ b/Documentation/git-rev-list.txt\n@@ -27,7 +27,8 @@ SYNOPSIS\n \t     [ \\--cherry-pick ]\n \t     [ \\--encoding[=<encoding>] ]\n \t     [ \\--(author|committer|grep)=<pattern> ]\n-\t     [ \\--regexp-ignore-case ] [ \\--extended-regexp ]\n+\t     [ \\--regexp-ignore-case | \\-i ]\n+\t     [ \\--extended-regexp | \\-E ]\n \t     [ \\--date={local|relative|default|iso|rfc|short} ]\n \t     [ [\\--objects | \\--objects-edge] [ \\--unpacked ] ]\n \t     [ \\--pretty | \\--header ]\n@@ -227,11 +228,11 @@ limiting may be applied.\n \tLimit the commits output to ones with log message that\n \tmatches the specified pattern (regular expression).\n \n---regexp-ignore-case::\n+--regexp-ignore-case, -i::\n \n \tMatch the regexp limiting patterns without regard to letters case.\n \n---extended-regexp::\n+--extended-regexp, -E::\n \n \tConsider the limiting patterns to be extended regular expressions\n \tinstead of the default basic regular expressions.\ndiff --git a/revision.c b/revision.c\nindex 7036cf2..00b75bc 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -1165,11 +1165,13 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch\n \t\t\t\tadd_message_grep(revs, arg+7);\n \t\t\t\tcontinue;\n \t\t\t}\n-\t\t\tif (!prefixcmp(arg, \"--extended-regexp\")) {\n+\t\t\tif (!strcmp(arg, \"--extended-regexp\") ||\n+\t\t\t    !strcmp(arg, \"-E\")) {\n \t\t\t\tregflags |= REG_EXTENDED;\n \t\t\t\tcontinue;\n \t\t\t}\n-\t\t\tif (!prefixcmp(arg, \"--regexp-ignore-case\")) {\n+\t\t\tif (!strcmp(arg, \"--regexp-ignore-case\") ||\n+\t\t\t    !strcmp(arg, \"-i\")) {\n \t\t\t\tregflags |= REG_ICASE;\n \t\t\t\tcontinue;\n \t\t\t}\n"},{"id":"48103","messageId":"a1bbc6950707220052v3b9b5032sd1b95d7b9c229a84@mail.gmail.com","threadId":"9132","inReplyTo":"7vwswtrmhe.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Added 'git-rev-list --igrep' option for case insensitive grep","fromName":"Dmitry Kakurin","fromEmail":"dmitry.kakurin@gmail.com","sentAt":"2007-07-22T07:52:12Z","receivedAt":"2007-07-22T07:52:12Z","isPatch":true,"sender":{"key":"dmitry.kakurin@gmail.com","avatar":null},"body":"Sounds good to me.\nLet's just put short option names in front of long names in the doc to\nbe consistent with other sections.\n\nOn 7/21/07, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n> > Are there notable side effects you would need to warn users\n> > about?\n> >\n> > For example, what is the difference between \"--igrep=foo\n> > --author=bar\" and \"--grep=foo --author=bar\"?\n>\n> Nah, let's not try to be too subtle.  It does not work.\n>\n> What I am wondering is if there is an unintended option name\n> conflict if we simply accept \"-i\" and \"-E\" as synonyms to\n> \"--regexp-ignore-case\" and \"--extended-regexp\".  The option\n> parser for log family in revision.c is used from many places,\n> so it is a bit hard to verify everobody to be absolutely sure,\n> but I do not think of any offhand.  There indeed are commands\n> that take \"-i\" to mean something other than ignore-case, but\n> ignore-case would not be meaningful for their operation.\n>\n> So I would rather prefer this replacement patch.\n>\n> -- >8 --\n> Synonyms: -i == --regexp-ignore-case, -E == --extended-regexp\n>\n> These options to log family were too long to type.  Give them\n> shorter synonyms.\n>\n> Fix the parsing of the long options while at it.\n>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  Documentation/git-rev-list.txt |    7 ++++---\n>  revision.c                     |    6 ++++--\n>  2 files changed, 8 insertions(+), 5 deletions(-)\n>\n> diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt\n> index 08e7573..f9fadaf 100644\n> --- a/Documentation/git-rev-list.txt\n> +++ b/Documentation/git-rev-list.txt\n> @@ -27,7 +27,8 @@ SYNOPSIS\n>              [ \\--cherry-pick ]\n>              [ \\--encoding[=<encoding>] ]\n>              [ \\--(author|committer|grep)=<pattern> ]\n> -            [ \\--regexp-ignore-case ] [ \\--extended-regexp ]\n> +            [ \\--regexp-ignore-case | \\-i ]\n> +            [ \\--extended-regexp | \\-E ]\n>              [ \\--date={local|relative|default|iso|rfc|short} ]\n>              [ [\\--objects | \\--objects-edge] [ \\--unpacked ] ]\n>              [ \\--pretty | \\--header ]\n> @@ -227,11 +228,11 @@ limiting may be applied.\n>         Limit the commits output to ones with log message that\n>         matches the specified pattern (regular expression).\n>\n> ---regexp-ignore-case::\n> +--regexp-ignore-case, -i::\n>\n>         Match the regexp limiting patterns without regard to letters case.\n>\n> ---extended-regexp::\n> +--extended-regexp, -E::\n>\n>         Consider the limiting patterns to be extended regular expressions\n>         instead of the default basic regular expressions.\n> diff --git a/revision.c b/revision.c\n> index 7036cf2..00b75bc 100644\n> --- a/revision.c\n> +++ b/revision.c\n> @@ -1165,11 +1165,13 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch\n>                                 add_message_grep(revs, arg+7);\n>                                 continue;\n>                         }\n> -                       if (!prefixcmp(arg, \"--extended-regexp\")) {\n> +                       if (!strcmp(arg, \"--extended-regexp\") ||\n> +                           !strcmp(arg, \"-E\")) {\n>                                 regflags |= REG_EXTENDED;\n>                                 continue;\n>                         }\n> -                       if (!prefixcmp(arg, \"--regexp-ignore-case\")) {\n> +                       if (!strcmp(arg, \"--regexp-ignore-case\") ||\n> +                           !strcmp(arg, \"-i\")) {\n>                                 regflags |= REG_ICASE;\n>                                 continue;\n>                         }\n>\n>\n"}]}