[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 the
community standards, but we would greatly appreciate feedback. We've been
working on this for a few weeks, and I just noticed that René Scharfe has done
conflicing (and better) refactoring work in diffcore-pickaxe.c a few days ago.
We'd be happy to rebase our changes and resolve the conflicts once René's
patches are committed to master, but we thought we may as well ask for comments
on the version we have working now.

Thanks for your time!

  .gitattributes: specify the language used
  diffcore-pickaxe.c: refactor regex compilation
  diffcore-pickaxe.c: Refactor pickaxe_fn signature
  diff.c/diff.h: expose userdiff_funcname
  diffcore-pickaxe.c: set up funcname pattern
  log: --function-name pickaxe
  xdiff: add XDL_EMIT_MOREFUNCNAMES to try harder
  xdiff: add XDL_EMIT_MOREHUNKHEADS to split hunks
  t4213: test --function-name option
  Documentation: Document --function-name usage

 .gitattributes |   2 +-
 Documentation/diff-options.txt |   9 +++
 Documentation/gitdiffcore.txt  |  17 -
 builtin/log.c  |   2 +-
 diff.c |  13 +++-
 diff.h |   3 +
 diffcore-pickaxe.c | 162 
+++---
 revision.c |   3 +-
 t/t4213-log-function-name.sh   |  73 +
 xdiff/xdiff.h  |   2 +
 xdiff/xdiffi.c |   2 +-
 xdiff/xemit.c  |  99 ++--
 xdiff/xemit.h  |   4 +-
 13 files changed, 323 insertions(+), 68 deletions(-)
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2014-03-27 Thread Jeff King
On Thu, Mar 27, 2014 at 02:50:46PM -0400, David A. Dalrymple (and Bhushan G. 
Lodha) wrote:

 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).

How does your feature compare with the line-level history viewer? E.g.:

  git log -L:myfunc:foo.c

I guess by being part of pickaxe, it can be used to generally select
commits (whereas -L is about drilling down a particular set of lines,
so something like --full-diff would not work).

But -L can do many things that pickaxe can't. It is not just about
finding lines touched within a pattern, but uses the pattern to
determine an initial set of lines, and then recursively blames those
lines going back through history. So how you specify the pattern is more
flexible (you can give any line range, for example), and it should be
able to cross boundaries like function renames.

-Peff
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html