Re: [GSoC][RFC/PATCH] userdiff: added support for diffing shell scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/24, Kapil Jain wrote:
> On Sun, Mar 24, 2019 at 2:49 PM Christian Couder
> <christian.couder@xxxxxxxxx> wrote:
> >
> > The test_language_driver() function used to test the regexps is
> > ...
> > GIT_TEST_CMP which is usually either "diff -u" or "diff -c".
> 
> Thanks.
> 
> please provide some insights on the regex mentioned below:

I had previously mentioned that this project was attempted already in
my email at [*1*].  Did you take a look at the thread I linked to
there, and the regex used?  I still feel like that previous experience
is something you could learn from.

But that said, I think your assumption in the other email that the
output should be

[-$TEST_DIRECTORY-]
{+$TEST_DIR+}

might not be correct.  The tests are using 'git diff
--word-diff=color', rather than 'git diff --word-diff=plain'.  Only
the latter would add the [- -] and {+ +} around the changed words,
while the former adds the color, which the tests are testing for.

*1*: https://public-inbox.org/git/20190315230515.GJ16414@xxxxxxxxxxxxxxxxxxxxxxxx/

> +
> +PATTERNS("shell",
> +  /* Function Names */
> +  "([A-Za-z_][A-Za-z0-9_]*)[[:space:]]*\\([[:space:]]*\\)[[:space:]]*\\{",
> +  /* Words */
> +  "([$#@A-Za-z_\"\'][$#@A-Za-z0-9_\"\']*)"),
> +
> 
> reference mail:
> https://public-inbox.org/git/20190324084523.8744-1-jkapil.cs@xxxxxxxxx/.
> please let me know if the regex is not self explanatory.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux