* [PATCH v2 1/2] Documentation: change -L:<regex> to -L:<funcname>
[not found] <CAHYJk3RQwDrtox+vB7G70qu1iCDcxCNDfxWyFS7_2CZQZCAgLA@mail.gmail.com>
@ 2015-04-20 12:09 ` Matthieu Moy
2015-04-20 12:09 ` [PATCH v2 2/2] log -L: improve error message on malformed argument Matthieu Moy
0 siblings, 1 reply; 2+ messages in thread
From: Matthieu Moy @ 2015-04-20 12:09 UTC (permalink / raw)
To: gitster; +Cc: git, mikachu, ramsay, Matthieu Moy
The old wording was somehow implying that <start> and <end> were not
regular expressions. Also, the common case is to use a plain function
name here so <funcname> makes sense (the fact that it is a regular
expression is documented in line-range-format.txt).
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Change since v1: changed one forgotten <regex> instance to <funcname>,
and spell out "function name" completely in the text explaining it.
Documentation/blame-options.txt | 2 +-
Documentation/git-log.txt | 4 ++--
Documentation/gitk.txt | 4 ++--
Documentation/line-range-format.txt | 11 ++++++-----
4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/Documentation/blame-options.txt b/Documentation/blame-options.txt
index 0cebc4f..23b8ff8 100644
--- a/Documentation/blame-options.txt
+++ b/Documentation/blame-options.txt
@@ -10,7 +10,7 @@
Include additional statistics at the end of blame output.
-L <start>,<end>::
--L :<regex>::
+-L :<funcname>::
Annotate only the given line range. May be specified multiple times.
Overlapping ranges are allowed.
+
diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index 1f7bc67..6e65c5a 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -62,9 +62,9 @@ produced by `--stat`, etc.
output by allowing them to allocate space in advance.
-L <start>,<end>:<file>::
--L :<regex>:<file>::
+-L :<funcname>:<file>::
Trace the evolution of the line range given by "<start>,<end>"
- (or the funcname regex <regex>) within the <file>. You may
+ (or the function name regex <funcname>) within the <file>. You may
not give any pathspec limiters. This is currently limited to
a walk starting from a single revision, i.e., you may only
give zero or one positive revision arguments.
diff --git a/Documentation/gitk.txt b/Documentation/gitk.txt
index 7ae50aa..6ade002 100644
--- a/Documentation/gitk.txt
+++ b/Documentation/gitk.txt
@@ -99,10 +99,10 @@ linkgit:git-rev-list[1] for a complete list.
detailed explanation.)
-L<start>,<end>:<file>::
--L:<regex>:<file>::
+-L:<funcname>:<file>::
Trace the evolution of the line range given by "<start>,<end>"
- (or the funcname regex <regex>) within the <file>. You may
+ (or the function name regex <funcname>) within the <file>. You may
not give any pathspec limiters. This is currently limited to
a walk starting from a single revision, i.e., you may only
give zero or one positive revision arguments.
diff --git a/Documentation/line-range-format.txt b/Documentation/line-range-format.txt
index d7f2603..829676f 100644
--- a/Documentation/line-range-format.txt
+++ b/Documentation/line-range-format.txt
@@ -22,8 +22,9 @@ This is only valid for <end> and will specify a number
of lines before or after the line given by <start>.
+
-If ``:<regex>'' is given in place of <start> and <end>, it denotes the range
-from the first funcname line that matches <regex>, up to the next
-funcname line. ``:<regex>'' searches from the end of the previous `-L` range,
-if any, otherwise from the start of file.
-``^:<regex>'' searches from the start of file.
+If ``:<funcname>'' is given in place of <start> and <end>, it is a
+regular expression that denotes the range from the first funcname line
+that matches <funcname>, up to the next funcname line. ``:<funcname>''
+searches from the end of the previous `-L` range, if any, otherwise
+from the start of file. ``^:<funcname>'' searches from the start of
+file.
--
2.4.0.rc1.42.g9642cc6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH v2 2/2] log -L: improve error message on malformed argument
2015-04-20 12:09 ` [PATCH v2 1/2] Documentation: change -L:<regex> to -L:<funcname> Matthieu Moy
@ 2015-04-20 12:09 ` Matthieu Moy
0 siblings, 0 replies; 2+ messages in thread
From: Matthieu Moy @ 2015-04-20 12:09 UTC (permalink / raw)
To: gitster; +Cc: git, mikachu, ramsay, Matthieu Moy
The old message did not mention the :regex:file form.
To avoid overly long lines, split the message into two lines (in case
item->string is long, it will be the only part truncated in a narrow
terminal).
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
No change since v1 (except Junio's changes).
line-log.c | 2 +-
t/t4211-line-log.sh | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/line-log.c b/line-log.c
index b7864ad..1a6bc59 100644
--- a/line-log.c
+++ b/line-log.c
@@ -575,7 +575,7 @@ parse_lines(struct commit *commit, const char *prefix, struct string_list *args)
name_part = skip_range_arg(item->string);
if (!name_part || *name_part != ':' || !name_part[1])
- die("-L argument '%s' not of the form start,end:file",
+ die("-L argument not 'start,end:file' or ':funcname:file': %s",
item->string);
range_part = xstrndup(item->string, name_part - item->string);
name_part++;
diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh
index 0901b30..4451127 100755
--- a/t/t4211-line-log.sh
+++ b/t/t4211-line-log.sh
@@ -54,14 +54,14 @@ canned_test "-L 4:a.c -L 8,12:a.c simple" multiple-superset
canned_test "-L 8,12:a.c -L 4:a.c simple" multiple-superset
test_bad_opts "-L" "switch.*requires a value"
-test_bad_opts "-L b.c" "argument.*not of the form"
-test_bad_opts "-L 1:" "argument.*not of the form"
+test_bad_opts "-L b.c" "argument not .start,end:file"
+test_bad_opts "-L 1:" "argument not .start,end:file"
test_bad_opts "-L 1:nonexistent" "There is no path"
test_bad_opts "-L 1:simple" "There is no path"
-test_bad_opts "-L '/foo:b.c'" "argument.*not of the form"
+test_bad_opts "-L '/foo:b.c'" "argument not .start,end:file"
test_bad_opts "-L 1000:b.c" "has only.*lines"
test_bad_opts "-L 1,1000:b.c" "has only.*lines"
-test_bad_opts "-L :b.c" "argument.*not of the form"
+test_bad_opts "-L :b.c" "argument not .start,end:file"
test_bad_opts "-L :foo:b.c" "no match"
test_expect_success '-L X (X == nlines)' '
--
2.4.0.rc1.42.g9642cc6
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-04-20 12:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAHYJk3RQwDrtox+vB7G70qu1iCDcxCNDfxWyFS7_2CZQZCAgLA@mail.gmail.com>
2015-04-20 12:09 ` [PATCH v2 1/2] Documentation: change -L:<regex> to -L:<funcname> Matthieu Moy
2015-04-20 12:09 ` [PATCH v2 2/2] log -L: improve error message on malformed argument Matthieu Moy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).