git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
PWPete Wyckoff <pw@padd.com>
Date
Nov 26, 2008, 18:52 UTC
Message-ID
<20081126185215.GA11037@osc.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
Next: Junio C Hamano
Message 1 of 4 in “git-p4: fix keyword-expansion regex”
  1. git-p4: fix keyword-expansion regexPete Wyckoff, Nov 26, 2008
  2. Junio C HamanoNov 26, 2008
  3. Simon HausmannNov 27, 2008
  4. Junio C HamanoNov 28, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.