git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Thomas Gummerer <t.gummerer@gmail.com>
Date
Mar 28, 2019, 21:30 UTC
Message-ID
<20190328213010.GI32487@hank.intra.tgummerer.com>
In-Reply-To
<CAMknYENJ+U4urtSEtwDSLpdwGe=x=uq_HdSs-cT9Z+PT5ZQiLg@mail.gmail.com>
On 03/24, Kapil Jain wrote:
Show 10 quoted lines
> On Sun, Mar 24, 2019 at 2:49 PM Christian Couder
> <christian.couder@gmail.com> 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@hank.intra.tgummerer.com/
Show 11 quoted lines
> +
> +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@gmail.com/.
> please let me know if the regex is not self explanatory.
Previous: Kapil JainNext: Kapil Jain
Message 6 of 9 in “userdiff: added support for diffing shell scripts”
  1. Kapil JainMar 22, 2019
  2. Christian CouderMar 23, 2019
  3. Kapil JainMar 24, 2019
  4. Christian CouderMar 24, 2019
  5. Kapil JainMar 24, 2019
  6. Thomas GummererMar 28, 2019
  7. Kapil JainMar 29, 2019
  8. Thomas GummererMar 29, 2019
  9. [GSoC][RFC/PATCH 2/2] userdiff: added shell script support, clears testKapil Jain, Mar 24, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.