threads / patch / 16480

patchgit-p4: fix keyword-expansion regex

Subject: [PATCH] git-p4: fix keyword-expansion regex

## tl;dr

4 messages between Nov 26, 2008 and Nov 28, 2008. Diffs are folded; open one to read it.

replies: 3people: 3as markdown or json

Pete Wyckoff· Nov 26, 2008, 18:52 UTC · lore
This text:
     my $dir = $File::Find::dir;
     return if ($dir !~ m,$options->{dirpat}$,);
was improperly converted to:
     my $dir = $File$dir !~ m,$options->{dirpat}$,);

by the keyword identifier expansion code. Add a \n to make sure the regex doesn't go across end-of-line boundaries.

Signed-off-by: Pete Wyckoff <pw@padd.com>
---
 contrib/fast-import/git-p4 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to contrib/fast-import/git-p4 +1 −1
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 9b04ca5..09317af 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1005,7 +1005,7 @@ class P4Sync(Command):
             if stat['type'] in ('text+ko', 'unicode+ko', 'binary+ko'):
                 text = re.sub(r'(?i)\$(Id|Header):[^$]*\$',r'$\1$', text)
             elif stat['type'] in ('text+k', 'ktext', 'kxtext', 'unicode+k', 'binary+k'):
-                text = re.sub(r'\$(Id|Header|Author|Date|DateTime|Change|File|Revision):[^$]*\$',r'$\1$', text)
+                text = re.sub(r'\$(Id|Header|Author|Date|DateTime|Change|File|Revision):[^$\n]*\$',r'$\1$', text)
 
             contents[stat['depotFile']] = text
 
-- 
1.5.6.5
Simon Hausmann· Nov 27, 2008, 16:45 UTC · re: Junio C Hamano · lore

Re: [PATCH] git-p4: fix keyword-expansion regex

On Wednesday 26 November 2008 Junio C Hamano, wrote:
> I will queue this to 'pu' and wait for an Ack from git-p4 folks.   Thanks.
Acked-by: Simon Hausmann <simon@lst.de>
Simon
Junio C Hamano· Nov 28, 2008, 22:29 UTC · re: Simon Hausmann · lore

Re: [PATCH] git-p4: fix keyword-expansion regex

Simon Hausmann <simon@lst.de> writes:
> On Wednesday 26 November 2008 Junio C Hamano, wrote:
>> I will queue this to 'pu' and wait for an Ack from git-p4 folks.   Thanks.
>
> Acked-by: Simon Hausmann <simon@lst.de>
Thanks.

← back to recent threads