[GSoC][RFC/PATCH 2/2] userdiff: added shell script support, clears test

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

 



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

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





[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