From: Junio C Hamano <gitster@pobox.com>
To: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] diff: add ruby funcname pattern
Date: Fri, 01 Aug 2008 00:30:36 -0700 [thread overview]
Message-ID: <7vmyjxtco3.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 1217488908-19692-1-git-send-email-giuseppe.bilotta@gmail.com
Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:
> Provide a regexp that catches class, module and method definitions in
> Ruby scripts, since the built-in default only finds classes.
>
> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
> ---
> diff.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/diff.c b/diff.c
> index cbf2547..c253015 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -1381,6 +1381,7 @@ static struct builtin_funcname_pattern {
> "[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
> "[ ]*([^;]*\\)$" },
> { "tex", "^\\(\\\\\\(sub\\)*section{.*\\)$" },
> + { "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
> };
>
> static const char *diff_funcname_pattern(struct diff_filespec *one)
Thanks.
I do not talk Ruby, so I'll wait for a few days to hear any one of the
following happen before deciding what to do with this patch:
(1) Yeah, this is a sufficient and necessary set of keywords, and it
would make my Ruby life so much better;
(2) This might be a good start but you need to cover this and that
keywords as well;
(3) This will misidentify a line that is not the beginning of a
definition, and should not be applied;
Needless to say, "Here is a better patch" is appreciated if somebody says
(2) or (3).
next prev parent reply other threads:[~2008-08-01 7:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-31 7:21 [PATCH] diff: add ruby funcname pattern Giuseppe Bilotta
2008-08-01 7:30 ` Junio C Hamano [this message]
2008-08-01 8:11 ` Giuseppe Bilotta
2008-08-01 8:20 ` Junio C Hamano
2008-08-01 8:39 ` Giuseppe Bilotta
2008-08-01 14:41 ` Jeff King
2008-08-02 0:31 ` Kevin Ballard
2008-08-02 3:50 ` Junio C Hamano
2008-08-02 5:41 ` Giuseppe Bilotta
2008-08-02 5:47 ` Kevin Ballard
2008-08-02 6:06 ` Giuseppe Bilotta
2008-08-02 11:39 ` Johannes Schindelin
2008-08-02 11:50 ` Giuseppe Bilotta
2008-08-02 15:37 ` Lee Marlow
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=7vmyjxtco3.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=giuseppe.bilotta@gmail.com \
/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).