diff options
author | Thomas Rast <trast@student.ethz.ch> | 2013-03-28 17:47:33 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-03-28 10:30:04 -0700 |
commit | 13b8f68c1f0b6d4ff5a7bed5a834e7e5e34a9fd0 (patch) | |
tree | 8e28bd102d82587678bb9ab32345f26039bf0ad4 /Documentation | |
parent | 12da1d1f6ffcd546a892a33302bb34fd37169022 (diff) | |
download | git-13b8f68c1f0b6d4ff5a7bed5a834e7e5e34a9fd0.tar.gz |
log -L: :pattern:file syntax to find by funcname
This new syntax finds a funcname matching /pattern/, and then takes from there
up to (but not including) the next funcname. So you can say
git log -L:main:main.c
and it will dig up the main() function and show its line-log, provided
there are no other funcnames matching 'main'.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/blame-options.txt | 2 | ||||
-rw-r--r-- | Documentation/git-blame.txt | 6 | ||||
-rw-r--r-- | Documentation/git-log.txt | 11 | ||||
-rw-r--r-- | Documentation/line-range-format.txt | 7 |
4 files changed, 17 insertions, 9 deletions
diff --git a/Documentation/blame-options.txt b/Documentation/blame-options.txt index 6998d9f5bf..e9f984ba01 100644 --- a/Documentation/blame-options.txt +++ b/Documentation/blame-options.txt @@ -9,7 +9,7 @@ --show-stats:: Include additional statistics at the end of blame output. --L <start>,<end>:: +-L <start>,<end>, -L :<regex>:: Annotate only the given line range. <start> and <end> can take one of these forms: diff --git a/Documentation/git-blame.txt b/Documentation/git-blame.txt index 9a05c2b3d2..6cea7f1ce1 100644 --- a/Documentation/git-blame.txt +++ b/Documentation/git-blame.txt @@ -8,9 +8,9 @@ git-blame - Show what revision and author last modified each line of a file SYNOPSIS -------- [verse] -'git blame' [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental] [-L n,m] - [-S <revs-file>] [-M] [-C] [-C] [-C] [--since=<date>] [--abbrev=<n>] - [<rev> | --contents <file> | --reverse <rev>] [--] <file> +'git blame' [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental] + [-L n,m | -L :fn] [-S <revs-file>] [-M] [-C] [-C] [-C] [--since=<date>] + [--abbrev=<n>] [<rev> | --contents <file> | --reverse <rev>] [--] <file> DESCRIPTION ----------- diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt index 8727c60ab3..4850226aaf 100644 --- a/Documentation/git-log.txt +++ b/Documentation/git-log.txt @@ -69,12 +69,13 @@ produced by --stat etc. Note that only message is considered, if also a diff is shown its size is not included. --L <start>,<end>:<file>:: +-L <start>,<end>:<file>, -L :<regex>:<file>:: + Trace the evolution of the line range given by "<start>,<end>" - 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. + (or the funcname regex <regex>) 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. <start> and <end> can take one of these forms: diff --git a/Documentation/line-range-format.txt b/Documentation/line-range-format.txt index 265bc23290..3e7ce72daa 100644 --- a/Documentation/line-range-format.txt +++ b/Documentation/line-range-format.txt @@ -16,3 +16,10 @@ starting at the line given by <start>. This is only valid for <end> and will specify a number of lines before or after the line given by <start>. + + +- :regex ++ +If the option's argument is of the form :regex, it denotes the range +from the first funcname line that matches <regex>, up to the next +funcname line. ++ |