git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Kapil Jain <jkapil.cs@gmail.com>
Cc: git@vger.kernel.org, Thomas Gummerer <t.gummerer@gmail.com>
Subject: Re: [GSoC] Microproject: Add more builtin patterns for userdiff
Date: Fri, 15 Mar 2019 13:56:07 +0100	[thread overview]
Message-ID: <8736nob8k8.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <CAMknYEMgJ88zWsebxBqsLq8LUwYzg0vN3RpsWVpbqvncrd5dGQ@mail.gmail.com>


On Fri, Mar 15 2019, Kapil Jain wrote:

> Hi,
>
> for the microproject: creating diff function support for different languages.
> i wrote one for shell script, have tested it outside of git and it works fine.
>
> query regarding accommodating the pattern in:
> 1) userdiff.c, it uses - #define PATTERNS(name, pattern, word_regex),
> for defining patterns to locate functions.
> what is the use of pattern and word_regex parameters ? i am guessing
> that pattern parameter is the actual pattern to spot functions in a
> file,

Yes, except "functions". More like "logical start of
stuff". E.g. "package" statements for Perl etc.

So whatever makes the most sense to put in the "@" context line for diff
to give the user an idea of what "function" this is changing, in the
loosest possible sense of "function".

> and word_regex is used to get function name. is that correct ?
> please let me know.

No, it's whatever counts as a "token" in the language for the purpose of
"diff --word-diff". So it needs to match e.g. operators as one unit.

      reply	other threads:[~2019-03-15 12:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-15  9:09 [GSoC] Microproject: Add more builtin patterns for userdiff Kapil Jain
2019-03-15 12:56 ` Ævar Arnfjörð Bjarmason [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=8736nob8k8.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jkapil.cs@gmail.com \
    --cc=t.gummerer@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).