[PATCH 00/10] [RFC] pickaxe for function names

2014-03-27 Thread David A. Dalrymple (and Bhushan G. Lodha)
This series introduces a --function-name=pattern option for git-log, intended to search for commits which touch a function matching a certain pattern (a feature we've seen requested and are interested in using ourselves). This is our first attempt to patch git; we've tried to observe and follow

[PATCH 09/10] t4213: test --function-name option

2014-03-27 Thread David A. Dalrymple (and Bhushan G. Lodha)
From: Bhushan G. Lodha David A. Dalrymple dad-...@mit.edu This test builds a sample C file, adding and removing functions, and checks that the right commits are filtered by --function-name matching. Signed-off-by: David Dalrymple (on zayin) davi...@alum.mit.edu --- t/t4213-log-function-name.sh

[PATCH 05/10] diffcore-pickaxe.c: set up funcname pattern

2014-03-27 Thread David A. Dalrymple (and Bhushan G. Lodha)
From: Bhushan G. Lodha David A. Dalrymple dad-...@mit.edu We use userdiff_funcname to make the filetype-dependent function name pattern available to pickaxe functions. Signed-off-by: David Dalrymple (on zayin) davi...@alum.mit.edu --- diffcore-pickaxe.c | 9 + 1 file changed, 9

[PATCH 06/10] log: --function-name pickaxe

2014-03-27 Thread David A. Dalrymple (and Bhushan G. Lodha)
From: Bhushan G. Lodha David A. Dalrymple dad-...@mit.edu This is similar to the pickaxe grep option (-G), but applies the provided regex only to diff hunk headers, thereby showing only those commits which affect a function with a definition line matching the pattern. These are functions

[PATCH 04/10] diff.c/diff.h: expose userdiff_funcname

2014-03-27 Thread David A. Dalrymple (and Bhushan G. Lodha)
From: Bhushan G. Lodha David A. Dalrymple dad-...@mit.edu The functionality of userdiff_funcname (determining the language in use for a given file and setting up patterns to match function names in that language) is useful outside of diff.c, so here we remove its static specifier and declare

[PATCH 02/10] diffcore-pickaxe.c: refactor regex compilation

2014-03-27 Thread David A. Dalrymple (and Bhushan G. Lodha)
From: Bhushan G. Lodha David A. Dalrymple dad-...@mit.edu In this file, two functions use identical blocks of code to call the POSIX regex compiling function and handle a possible error. Here we factor that block into its own function, in anticipation of using the same code a third time. Signed

[PATCH 03/10] diffcore-pickaxe.c: Refactor pickaxe_fn signature

2014-03-27 Thread David A. Dalrymple (and Bhushan G. Lodha)
From: Bhushan G. Lodha David A. Dalrymple dad-...@mit.edu This function type previously accepted separate regex_t and kwset_t parameters, which conceptually go together. Here we create a struct to encapsulate them, in anticipation of adding a third field that pickaxe_fn's may require

[PATCH 10/10] Documentation: Document --function-name usage

2014-03-27 Thread David A. Dalrymple (and Bhushan G. Lodha)
From: Bhushan Lodha David A. Dalrymple dad-...@mit.edu Signed-off-by: David Dalrymple (on zayin) davi...@alum.mit.edu --- Documentation/diff-options.txt | 9 + Documentation/gitdiffcore.txt | 17 ++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git

[PATCH 01/10] .gitattributes: specify the language used

2014-03-27 Thread David A. Dalrymple (and Bhushan G. Lodha)
From: Bhushan G. Lodha David A. Dalrymple dad-...@mit.edu Since git can intelligently emit diff hunk headers based on the programming language of each file, assuming that the language is specified in .gitattributes, it makes sense to specify our own language (cpp) in our own .gitattributes file

[PATCH 07/10] xdiff: add XDL_EMIT_MOREFUNCNAMES

2014-03-27 Thread David A. Dalrymple (and Bhushan G. Lodha)
From: Bhushan G. Lodha David A. Dalrymple dad-...@mit.edu For filtering commits by function name, it's useful to identify the function name in cases such as adding a new function to a file (where the default functionality will not emit a function name in the hunk header, because it isn't part

[PATCH 08/10] xdiff: add XDL_EMIT_MOREHUNKHEADS

2014-03-27 Thread David A. Dalrymple (and Bhushan G. Lodha)
From: Bhushan G. Lodha David A. Dalrymple dad-...@mit.edu For filtering by function names, it's useful to split hunks whenever a function line is encountered, so that each function name being deleted or inserted gets its own hunk header (which then can be easily detected by the filter