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

4 messages from 2008-11-26 to 2008-11-28. Participants: Pete Wyckoff, Junio C Hamano, Simon Hausmann.
Thread: https://gitlist.dev/t/16480

## Pete Wyckoff, 2008-11-26 18:52

Subject: [PATCH] git-p4: fix keyword-expansion regex
Message-ID: <20081126185215.GA11037@osc.edu>
URL: https://gitlist.dev/e/20081126185215.GA11037%40osc.edu

```
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(-)

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

```

## Junio C Hamano, 2008-11-26 20:33

Subject: Re: [PATCH] git-p4: fix keyword-expansion regex
Message-ID: <7vljv6fcr0.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vljv6fcr0.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20081126185215.GA11037@osc.edu>

```
I will queue this to 'pu' and wait for an Ack from git-p4 folks.   Thanks.

```

## Simon Hausmann, 2008-11-27 16:45

Subject: Re: [PATCH] git-p4: fix keyword-expansion regex
Message-ID: <200811271745.30963.simon@lst.de>
URL: https://gitlist.dev/e/200811271745.30963.simon%40lst.de
In-Reply-To: <7vljv6fcr0.fsf@gitster.siamese.dyndns.org>

```
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, 2008-11-28 22:29

Subject: Re: [PATCH] git-p4: fix keyword-expansion regex
Message-ID: <7vy6z37ad4.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vy6z37ad4.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <200811271745.30963.simon@lst.de>

```
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.

```
