git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: "David A. Dalrymple (and Bhushan G. Lodha)" <dad-bgl@mit.edu>,
	git@vger.kernel.org
Cc: peff@peff.net, "David Dalrymple (on zayin)" <davidad@alum.mit.edu>
Subject: Re: [PATCH 06/10] log: --function-name pickaxe
Date: Thu, 03 Apr 2014 23:25:05 +0200	[thread overview]
Message-ID: <533DD1B1.3000107@web.de> (raw)
In-Reply-To: <62ab0f9c34eabe020ae99c7c1f69d580d9bb36d8.1395942768.git.davidad@alum.mit.edu>

Am 27.03.2014 19:50, schrieb David A. Dalrymple (and Bhushan G. Lodha):
> From: "Bhushan G. Lodha & David A. Dalrymple" <dad-bgl@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" in the same sense as with
> --function-context, i.e., they may be classes, structs, etc. depending
> on the programming-language-specific pattern specified by the "diff"
> attribute in .gitattributes.

With that approach you depend on the hunk header and apparently need to 
add XDL_EMIT_MOREFUNCNAMES and XDL_EMIT_MOREHUNKHEADS to improve the 
results.  This approach feels fragile.

Would it perhaps be more robust to not base the implementation on diff 
and instead to scan the raw file contents?  You'd search both files for 
a matching function signature, then search for a non-matching one from 
there.  The parts in between are function bodies and can be compared. 
If they match, you'd search for matching function starts again etc.

Or would it make sense to make use of the diff option FUNCCONTEXT (git 
diff -W) and look for the function signature in the diff body instead of 
in the hunk header?  Such a diff contains whole functions, but a single 
hunk could contain multiple ones.

René

  reply	other threads:[~2014-04-03 21:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-27 18:50 [PATCH 00/10] [RFC] pickaxe for function names David A. Dalrymple (and Bhushan G. Lodha)
2014-03-27 18:50 ` [PATCH 01/10] .gitattributes: specify the language used David A. Dalrymple (and Bhushan G. Lodha)
2014-03-27 18:50   ` [PATCH 02/10] diffcore-pickaxe.c: refactor regex compilation David A. Dalrymple (and Bhushan G. Lodha)
2014-03-27 18:50   ` [PATCH 03/10] diffcore-pickaxe.c: Refactor pickaxe_fn signature David A. Dalrymple (and Bhushan G. Lodha)
2014-04-04 11:09     ` Jakub Narębski
2014-03-27 18:50   ` [PATCH 04/10] diff.c/diff.h: expose userdiff_funcname David A. Dalrymple (and Bhushan G. Lodha)
2014-03-27 18:50   ` [PATCH 05/10] diffcore-pickaxe.c: set up funcname pattern David A. Dalrymple (and Bhushan G. Lodha)
2014-03-27 18:50   ` [PATCH 06/10] log: --function-name pickaxe David A. Dalrymple (and Bhushan G. Lodha)
2014-04-03 21:25     ` René Scharfe [this message]
2014-04-03 21:44       ` Junio C Hamano
2014-04-04 11:15         ` Jakub Narębski
2014-04-04 18:46           ` Junio C Hamano
2014-04-28 20:04             ` Bhushan Lodha
2014-03-27 18:50   ` [PATCH 07/10] xdiff: add XDL_EMIT_MOREFUNCNAMES David A. Dalrymple (and Bhushan G. Lodha)
2014-03-27 18:50   ` [PATCH 08/10] xdiff: add XDL_EMIT_MOREHUNKHEADS David A. Dalrymple (and Bhushan G. Lodha)
2014-03-27 18:50   ` [PATCH 09/10] t4213: test --function-name option David A. Dalrymple (and Bhushan G. Lodha)
2014-03-28  7:25     ` Johannes Sixt
2014-03-28  8:21       ` Eric Sunshine
2014-03-28 11:45       ` Johannes Sixt
2014-04-04 11:21     ` Jakub Narębski
2014-03-27 18:50   ` [PATCH 10/10] Documentation: Document --function-name usage David A. Dalrymple (and Bhushan G. Lodha)
2014-03-28  0:30     ` Eric Sunshine
2014-03-27 19:03 ` [PATCH 00/10] [RFC] pickaxe for function names Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=533DD1B1.3000107@web.de \
    --to=l.s.r@web.de \
    --cc=dad-bgl@mit.edu \
    --cc=davidad@alum.mit.edu \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).