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>
This commit is contained in:
Thomas Rast
2013-03-28 17:47:33 +01:00
committed by Junio C Hamano
parent 12da1d1f6f
commit 13b8f68c1f
11 changed files with 333 additions and 15 deletions

View File

@ -19,7 +19,8 @@ typedef const char *(*nth_line_fn_t)(void *data, long lno);
extern int parse_range_arg(const char *arg,
nth_line_fn_t nth_line_cb,
void *cb_data, long lines,
long *begin, long *end);
long *begin, long *end,
const char *path);
/*
* Scan past a range argument that could be parsed by