{"thread":{"id":"39115","subject":"[PATCH v2 1/2] Documentation: change -L:<regex> to -L:<funcname>","startedAt":"2015-04-20T12:09:06Z","lastAt":"2015-04-20T12:09:07Z","messageCount":2,"participants":["Matthieu Moy"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"259672","messageId":"1429531747-15082-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"39115","inReplyTo":"CAHYJk3RQwDrtox+vB7G70qu1iCDcxCNDfxWyFS7_2CZQZCAgLA@mail.gmail.com","subject":"[PATCH v2 1/2] Documentation: change -L:<regex> to -L:<funcname>","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2015-04-20T12:09:06Z","receivedAt":"2015-04-20T12:09:06Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The old wording was somehow implying that <start> and <end> were not\nregular expressions. Also, the common case is to use a plain function\nname here so <funcname> makes sense (the fact that it is a regular\nexpression is documented in line-range-format.txt).\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\nChange since v1: changed one forgotten <regex> instance to <funcname>,\nand spell out \"function name\" completely in the text explaining it.\n\n Documentation/blame-options.txt     |  2 +-\n Documentation/git-log.txt           |  4 ++--\n Documentation/gitk.txt              |  4 ++--\n Documentation/line-range-format.txt | 11 ++++++-----\n 4 files changed, 11 insertions(+), 10 deletions(-)\n\ndiff --git a/Documentation/blame-options.txt b/Documentation/blame-options.txt\nindex 0cebc4f..23b8ff8 100644\n--- a/Documentation/blame-options.txt\n+++ b/Documentation/blame-options.txt\n@@ -10,7 +10,7 @@\n \tInclude additional statistics at the end of blame output.\n \n -L <start>,<end>::\n--L :<regex>::\n+-L :<funcname>::\n \tAnnotate only the given line range. May be specified multiple times.\n \tOverlapping ranges are allowed.\n +\ndiff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\nindex 1f7bc67..6e65c5a 100644\n--- a/Documentation/git-log.txt\n+++ b/Documentation/git-log.txt\n@@ -62,9 +62,9 @@ produced by `--stat`, etc.\n \toutput by allowing them to allocate space in advance.\n \n -L <start>,<end>:<file>::\n--L :<regex>:<file>::\n+-L :<funcname>:<file>::\n \tTrace the evolution of the line range given by \"<start>,<end>\"\n-\t(or the funcname regex <regex>) within the <file>.  You may\n+\t(or the function name regex <funcname>) within the <file>.  You may\n \tnot give any pathspec limiters.  This is currently limited to\n \ta walk starting from a single revision, i.e., you may only\n \tgive zero or one positive revision arguments.\ndiff --git a/Documentation/gitk.txt b/Documentation/gitk.txt\nindex 7ae50aa..6ade002 100644\n--- a/Documentation/gitk.txt\n+++ b/Documentation/gitk.txt\n@@ -99,10 +99,10 @@ linkgit:git-rev-list[1] for a complete list.\n \tdetailed explanation.)\n \n -L<start>,<end>:<file>::\n--L:<regex>:<file>::\n+-L:<funcname>:<file>::\n \n \tTrace the evolution of the line range given by \"<start>,<end>\"\n-\t(or the funcname regex <regex>) within the <file>.  You may\n+\t(or the function name regex <funcname>) within the <file>.  You may\n \tnot give any pathspec limiters.  This is currently limited to\n \ta walk starting from a single revision, i.e., you may only\n \tgive zero or one positive revision arguments.\ndiff --git a/Documentation/line-range-format.txt b/Documentation/line-range-format.txt\nindex d7f2603..829676f 100644\n--- a/Documentation/line-range-format.txt\n+++ b/Documentation/line-range-format.txt\n@@ -22,8 +22,9 @@ This is only valid for <end> and will specify a number\n of lines before or after the line given by <start>.\n \n +\n-If ``:<regex>'' is given in place of <start> and <end>, it denotes the range\n-from the first funcname line that matches <regex>, up to the next\n-funcname line. ``:<regex>'' searches from the end of the previous `-L` range,\n-if any, otherwise from the start of file.\n-``^:<regex>'' searches from the start of file.\n+If ``:<funcname>'' is given in place of <start> and <end>, it is a\n+regular expression that denotes the range from the first funcname line\n+that matches <funcname>, up to the next funcname line. ``:<funcname>''\n+searches from the end of the previous `-L` range, if any, otherwise\n+from the start of file. ``^:<funcname>'' searches from the start of\n+file.\n-- \n2.4.0.rc1.42.g9642cc6\n"},{"id":"259673","messageId":"1429531747-15082-2-git-send-email-Matthieu.Moy@imag.fr","threadId":"39115","inReplyTo":"1429531747-15082-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH v2 2/2] log -L: improve error message on malformed argument","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2015-04-20T12:09:07Z","receivedAt":"2015-04-20T12:09:07Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The old message did not mention the :regex:file form.\n\nTo avoid overly long lines, split the message into two lines (in case\nitem->string is long, it will be the only part truncated in a narrow\nterminal).\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\nNo change since v1 (except Junio's changes).\n\n line-log.c          | 2 +-\n t/t4211-line-log.sh | 8 ++++----\n 2 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/line-log.c b/line-log.c\nindex b7864ad..1a6bc59 100644\n--- a/line-log.c\n+++ b/line-log.c\n@@ -575,7 +575,7 @@ parse_lines(struct commit *commit, const char *prefix, struct string_list *args)\n \n \t\tname_part = skip_range_arg(item->string);\n \t\tif (!name_part || *name_part != ':' || !name_part[1])\n-\t\t\tdie(\"-L argument '%s' not of the form start,end:file\",\n+\t\t\tdie(\"-L argument not 'start,end:file' or ':funcname:file': %s\",\n \t\t\t    item->string);\n \t\trange_part = xstrndup(item->string, name_part - item->string);\n \t\tname_part++;\ndiff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh\nindex 0901b30..4451127 100755\n--- a/t/t4211-line-log.sh\n+++ b/t/t4211-line-log.sh\n@@ -54,14 +54,14 @@ canned_test \"-L 4:a.c -L 8,12:a.c simple\" multiple-superset\n canned_test \"-L 8,12:a.c -L 4:a.c simple\" multiple-superset\n \n test_bad_opts \"-L\" \"switch.*requires a value\"\n-test_bad_opts \"-L b.c\" \"argument.*not of the form\"\n-test_bad_opts \"-L 1:\" \"argument.*not of the form\"\n+test_bad_opts \"-L b.c\" \"argument not .start,end:file\"\n+test_bad_opts \"-L 1:\" \"argument not .start,end:file\"\n test_bad_opts \"-L 1:nonexistent\" \"There is no path\"\n test_bad_opts \"-L 1:simple\" \"There is no path\"\n-test_bad_opts \"-L '/foo:b.c'\" \"argument.*not of the form\"\n+test_bad_opts \"-L '/foo:b.c'\" \"argument not .start,end:file\"\n test_bad_opts \"-L 1000:b.c\" \"has only.*lines\"\n test_bad_opts \"-L 1,1000:b.c\" \"has only.*lines\"\n-test_bad_opts \"-L :b.c\" \"argument.*not of the form\"\n+test_bad_opts \"-L :b.c\" \"argument not .start,end:file\"\n test_bad_opts \"-L :foo:b.c\" \"no match\"\n \n test_expect_success '-L X (X == nlines)' '\n-- \n2.4.0.rc1.42.g9642cc6\n"}]}