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 /t/t4211-line-log.sh | |
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 't/t4211-line-log.sh')
-rwxr-xr-x | t/t4211-line-log.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh index 9f36f17384..426a82868e 100755 --- a/t/t4211-line-log.sh +++ b/t/t4211-line-log.sh @@ -25,8 +25,10 @@ test_bad_opts () { canned_test "-L 4,12:a.c simple" simple-f canned_test "-L 4,+9:a.c simple" simple-f canned_test "-L '/long f/,/^}/:a.c' simple" simple-f +canned_test "-L :f:a.c simple" simple-f-to-main canned_test "-L '/main/,/^}/:a.c' simple" simple-main +canned_test "-L :main:a.c simple" simple-main-to-end canned_test "-L 1,+4:a.c simple" beginning-of-file @@ -45,5 +47,7 @@ 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 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 :foo:b.c" "no match" test_done |