Re: [PATCH 1/3] Fixes bug: git-diff: class methods are not detected in hunk headers for Pascal

Previous thread: [PATCH 3/3] Fixes bug: GIT_PS1_SHOWDIRTYSTATE is no not respect diff.ignoreSubmodules config variable by Zapped on Friday, December 24, 2010 - 6:20 pm. (10 messages)

Next thread: [PATCH] close file on error in read_mmfile() by René Scharfe on Saturday, December 25, 2010 - 5:38 am. (3 messages)
From: Zapped
Date: Friday, December 24, 2010 - 6:20 pm

Signed-off-by: Zapped <zapped@mail.ru>
---
 userdiff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/userdiff.c b/userdiff.c
index f9e05b5..259a382 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -52,7 +52,7 @@ PATTERNS("objc",
 	 "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->"
 	 "|[^[:space:]]|[\x80-\xff]+"),
 PATTERNS("pascal",
-	 "^((procedure|function|constructor|destructor|interface|"
+	 "^(((class[ \t]+)?(procedure|function)|constructor|destructor|interface|"
 		"implementation|initialization|finalization)[ \t]*.*)$"
 	 "\n"
 	 "^(.*=[ \t]*(class|record).*)$",
-- 
1.7.3.4.3.g3f811

--

From: Thomas Rast
Date: Tuesday, January 4, 2011 - 10:13 am

As Junio already said, please provide a real name for the sign-off.
But I also found the commit message and content confusing, probably
because I haven't programmed Pascal for 15 years.

You said


But the last line very conspicuously already mentions 'class', so why
does it fail?

I had to look up a bit of Pascal syntax.  Google helped with

  http://www.freepascal.org/docs-html/ref/ref.html

which answers this.  Also, as stated in SubmittingPatches, we
generally word the messages as stating the behaviour of the changed
version in the present tense.  So a better commit message would be

  userdiff: match Pascal class methods

  Class declarations were already covered by the second pattern, but
  class methods have the 'class' keyword in front too.  Account for
  it.

  Signed-off-by: Алексей Крезов <zapped@mail.ru>

Ok, now I feel silly for only having a two-liner despite my
complaints.

That being said, I have now verified that the patch is good, and, you
can include my

  Acked-by: Thomas Rast <trast@student.ethz.ch>

in a reroll if you fix the above.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
--

Previous thread: [PATCH 3/3] Fixes bug: GIT_PS1_SHOWDIRTYSTATE is no not respect diff.ignoreSubmodules config variable by Zapped on Friday, December 24, 2010 - 6:20 pm. (10 messages)

Next thread: [PATCH] close file on error in read_mmfile() by René Scharfe on Saturday, December 25, 2010 - 5:38 am. (3 messages)