summaryrefslogtreecommitdiff
path: root/line-log.c
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2013-03-28 17:47:33 +0100
committerJunio C Hamano <gitster@pobox.com>2013-03-28 10:30:04 -0700
commit13b8f68c1f0b6d4ff5a7bed5a834e7e5e34a9fd0 (patch)
tree8e28bd102d82587678bb9ab32345f26039bf0ad4 /line-log.c
parent12da1d1f6ffcd546a892a33302bb34fd37169022 (diff)
downloadgit-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 'line-log.c')
-rw-r--r--line-log.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/line-log.c b/line-log.c
index 624423142e..68972e24c7 100644
--- a/line-log.c
+++ b/line-log.c
@@ -12,6 +12,7 @@
#include "strbuf.h"
#include "log-tree.h"
#include "graph.h"
+#include "userdiff.h"
#include "line-log.h"
static void range_set_grow(struct range_set *rs, size_t extra)
@@ -438,7 +439,6 @@ static void range_set_map_across_diff(struct range_set *out,
*touched_out = touched;
}
-
static struct commit *check_single_commit(struct rev_info *revs)
{
struct object *commit = NULL;
@@ -559,7 +559,8 @@ parse_lines(struct commit *commit, const char *prefix, struct string_list *args)
cb_data.line_ends = ends;
if (parse_range_arg(range_part, nth_line, &cb_data,
- lines, &begin, &end))
+ lines, &begin, &end,
+ spec->path))
die("malformed -L argument '%s'", range_part);
if (begin < 1)
begin = 1;