git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kapil Jain <jkapil.cs@gmail.com>
To: christian.couder@gmail.com
Cc: git@vger.kernel.org, t.gummerer@gmail.com,
	Kapil Jain <jkapil.cs@gmail.com>
Subject: [GSoC][RFC/PATCH 2/2] userdiff: added shell script support, clears test
Date: Sun, 24 Mar 2019 14:15:23 +0530	[thread overview]
Message-ID: <20190324084523.8744-1-jkapil.cs@gmail.com> (raw)
In-Reply-To: <CAP8UFD3K4ft7UVSFeaQzKVVGFPwcLcpTKB+sqFN9X9_j_A093w@mail.gmail.com>

Signed-off-by: Kapil Jain <jkapil.cs@gmail.com>
---

The test passes now, but imo the regex is not working,
because the output of git diff with shell regex remains same
as earlier it was without shell regex.

without shell regex the output was shown as:
-$TEST_DIRECTORY
+$TEST_DIR

with shell regex the output should be:
[-$TEST_DIRECTORY-]
{+$TEST_DIR+}

but even with shell regex the output is:
-$TEST_DIRECTORY
+$TEST_DIR

some thoughts on regex would be helpful.
the shell regex is below:

+
+PATTERNS("shell",
+  /* Function Names */
+  "([A-Za-z_][A-Za-z0-9_]*)[[:space:]]*\\([[:space:]]*\\)[[:space:]]*\\{",
+  /* Words */
+  "([$#@A-Za-z_\"\'][$#@A-Za-z0-9_\"\']*)"),
+

Thanks.

 t/t4034/shell/expect | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t4034/shell/expect b/t/t4034/shell/expect
index f2f65e7a9b..1f0d1e1d43 100644
--- a/t/t4034/shell/expect
+++ b/t/t4034/shell/expect
@@ -1,6 +1,6 @@
 <BOLD>diff --git a/pre b/post<RESET>
-<BOLD>index 2fc00ad..cd34305 100644<RESET>
+<BOLD>index 32440f9..43a84e0 100644<RESET>
 <BOLD>--- a/pre<RESET>
 <BOLD>+++ b/post<RESET>
 <CYAN>@@ -1 +1 @@<RESET>
-<RED>[-$TEST_DIRECTORY-]<RESET><GREEN>{+$TEST_DIR+}<RESET>
+<RED>$TEST_DIRECTORY<RESET><GREEN>$TEST_DIR<RESET>
-- 
2.20.1


      parent reply	other threads:[~2019-03-24  8:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22 16:06 [GSoC][RFC/PATCH] userdiff: added support for diffing shell scripts Kapil Jain
2019-03-23 20:04 ` Christian Couder
2019-03-24  8:04   ` Kapil Jain
2019-03-24  9:19     ` Christian Couder
2019-03-24 10:04       ` Kapil Jain
2019-03-28 21:30         ` Thomas Gummerer
2019-03-29 12:13           ` Kapil Jain
2019-03-29 19:07             ` Thomas Gummerer
2019-03-24  8:45   ` Kapil Jain [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

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

  git send-email \
    --in-reply-to=20190324084523.8744-1-jkapil.cs@gmail.com \
    --to=jkapil.cs@gmail.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --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.
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).