From: "David A. Dalrymple (and Bhushan G. Lodha)" <dad-bgl@mit.edu>
To: git@vger.kernel.org
Cc: peff@peff.net, l.s.r@web.de,
"Bhushan Lodha & David A. Dalrymple" <dad-bgl@mit.edu>,
"David Dalrymple (on zayin)" <davidad@alum.mit.edu>
Subject: [PATCH 10/10] Documentation: Document --function-name usage
Date: Thu, 27 Mar 2014 14:50:56 -0400 [thread overview]
Message-ID: <c5de064075e6a2192817aafde75d8075ae82c974.1395942768.git.davidad@alum.mit.edu> (raw)
In-Reply-To: <1395946256-67124-1-git-send-email-dad-bgl@mit.edu>
In-Reply-To: <a833f392bebae7a2441d0a6e81a1c6dc52fa682e.1395942768.git.davidad@alum.mit.edu>
From: "Bhushan Lodha & David A. Dalrymple" <dad-bgl@mit.edu>
Signed-off-by: David Dalrymple (on zayin) <davidad@alum.mit.edu>
---
Documentation/diff-options.txt | 9 +++++++++
Documentation/gitdiffcore.txt | 17 ++++++++++++++---
2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 9b37b2a..a778dff 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -427,6 +427,15 @@ information.
--pickaxe-regex::
Treat the <string> given to `-S` as an extended POSIX regular
expression to match.
+
+--function-name<regex>::
+ Look for differences whose patch text contains hunk headers that match
+ <regex>. This can be useful to locate changes to a particular function
+ or other semantic element in a program, since hunk headers are intended
+ to indicate the "function context" (in the sense of
+ `--function-context`) in which the particular change occurs. The
+ function context is determined by the diff driver corresponding to the
+ file in question; see linkgit:gitattributes[7] for details.
endif::git-format-patch[]
-O<orderfile>::
diff --git a/Documentation/gitdiffcore.txt b/Documentation/gitdiffcore.txt
index c8b3e51..b8477ce 100644
--- a/Documentation/gitdiffcore.txt
+++ b/Documentation/gitdiffcore.txt
@@ -222,10 +222,11 @@ version prefixed with '+'.
diffcore-pickaxe: For Detecting Addition/Deletion of Specified String
---------------------------------------------------------------------
-This transformation limits the set of filepairs to those that change
+This transformation limits the set of filepairs to those that involve
specified strings between the preimage and the postimage in a certain
-way. -S<block of text> and -G<regular expression> options are used to
-specify different ways these strings are sought.
+way. -S<block of text>, -G<regular expression>, and
+--function-name<regular expression> options are used to specify
+different ways these strings are sought.
"-S<block of text>" detects filepairs whose preimage and postimage
have different number of occurrences of the specified block of text.
@@ -251,6 +252,16 @@ criterion in a changeset, the entire changeset is kept. This behavior
is designed to make reviewing changes in the context of the whole
changeset easier.
+"--function-name<regular expression>" detects filepairs whose textual
+diff contains a hunk header that matches the given regular expression.
+The hunk header is generated via the diff driver specified in
+`.gitattributes`, and is intended to reflect the "function context"
+(in the sense of `--function-context`) in which the change occurs,
+with programming-language-dependent heuristics. As of now, the
+programming language is not auto-detected in any way. Also note that
+hunks whose headers do not match the regular expression are not
+currently filtered out; this is only a filepair filter.
+
diffcore-order: For Sorting the Output Based on Filenames
---------------------------------------------------------
--
1.7.12.4 (Apple Git-37)
next prev parent reply other threads:[~2014-03-27 18:51 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
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 ` David A. Dalrymple (and Bhushan G. Lodha) [this message]
2014-03-28 0:30 ` [PATCH 10/10] Documentation: Document --function-name usage 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=c5de064075e6a2192817aafde75d8075ae82c974.1395942768.git.davidad@alum.mit.edu \
--to=dad-bgl@mit.edu \
--cc=davidad@alum.mit.edu \
--cc=git@vger.kernel.org \
--cc=l.s.r@web.de \
--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).