threads / patch / 11813

patchcvsimport: have default merge regex also match beginning of commit message

Subject: [PATCH] cvsimport: have default merge regex also match beginning of commit message

## tl;dr

2 messages between Feb 1, 2008 and Feb 7, 2008. Diffs are folded; open one to read it.

replies: 1people: 1as markdown or json

Gerrit Pape· Feb 1, 2008, 13:15 UTC · lore

The default value of @mergerx uses \W, which matches a non-word character; this means that commit messages like "Merging FOO" are not matched by default; using \b, which matches a word boundary, instead of \W fixes that.

This change was suggested by Fr�d�ric Bri�re through
 http://bugs.debian.org/463468
Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 git-cvsimport.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to git-cvsimport.perl +1 −1
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 5694978..9516242 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -164,7 +164,7 @@ if ($#ARGV == 0) {
 
 our @mergerx = ();
 if ($opt_m) {
-	@mergerx = ( qr/\W(?:from|of|merge|merging|merged) (\w+)/i );
+	@mergerx = ( qr/\b(?:from|of|merge|merging|merged) (\w+)/i );
 }
 if ($opt_M) {
 	push (@mergerx, qr/$opt_M/);
-- 
1.5.3.8
Gerrit Pape· Feb 7, 2008, 09:36 UTC · re: Gerrit Pape · lore

[PATCH/resend] cvsimport: have default merge regex also match beginning of commit message

The default value of @mergerx uses \W, which matches a non-word character; this means that commit messages like "Merging FOO" are not matched by default; using \b, which matches a word boundary, instead of \W fixes that.

This change was suggested by Fr�d�ric Bri�re through
 http://bugs.debian.org/463468
Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 git-cvsimport.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to git-cvsimport.perl +1 −1
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 5694978..9516242 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -164,7 +164,7 @@ if ($#ARGV == 0) {
 
 our @mergerx = ();
 if ($opt_m) {
-	@mergerx = ( qr/\W(?:from|of|merge|merging|merged) (\w+)/i );
+	@mergerx = ( qr/\b(?:from|of|merge|merging|merged) (\w+)/i );
 }
 if ($opt_M) {
 	push (@mergerx, qr/$opt_M/);
-- 
1.5.4

← back to recent threads