From 13b8f68c1f0b6d4ff5a7bed5a834e7e5e34a9fd0 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Thu, 28 Mar 2013 17:47:33 +0100 Subject: 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 Signed-off-by: Junio C Hamano --- t/t4211-line-log.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 't/t4211-line-log.sh') 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 -- cgit v1.2.3