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

Re: [PATCHv3] git-p4: add initial support for RCS keywords

From
Eric Scouten <eric@scouten.com>
Date
Feb 21, 2012, 16:54 UTC
Message-ID
<CAEe=O8qui8PryuZiZNDwLk39+tKVDnh+5eP9m_WrHi=K9ekMNQ@mail.gmail.com>
In-Reply-To
<20120221121834.GB18317@padd.com>
[Resent in plain-text. Apologies for dupe content to Pete and Luke.]
On Tue, Feb 21, 2012 at 04:18, Pete Wyckoff <pw@padd.com> wrote:
> luke@diamand.org wrote on Tue, 14 Feb 2012 22:33 +0000:
Show 14 quoted lines
> > diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
> > +#
> > +# Given a type base and modifier, return a regexp matching
> > +# the keywords that can be expanded in the file
> > +#
> > +def p4_keywords_regexp_for_type(base, type_mods):
> > +    if base in ("text", "unicode", "binary"):
> > +        if "ko" in type_mods:
> > +            return r'\$(Id|Header)[^$]*\$'
> > +        elif "k" in type_mods:
> > +            return
> > r'\$(Id|Header|Author|Date|DateTime|Change|File|Revision)[^$]*\$'
>
> Still no ":"?  Won't that match too much?
> Fix the colon thing at least, then happy to add my Acked-By.

No, that would be an incorrect change. The colon is added by P4 when it expands the keyword pattern, but it is *not* part of the pattern required by P4 to trigger a keyword expansion.

http://kb.perforce.com/article/54/using-rcs-keywords
-Eric

-- Eric Scouten :: software developer, photographer :: Poulsbo, WA (near Seattle) http://ericscouten.com :: click for Flickr, Facebook, Twitter, LinkedIn links

Previous: Pete WyckoffNext: Junio C Hamano
Message 5 of 7 in “[PATCHv3] git-p4: RCS keyword handling”
  1. Luke DiamandFeb 14, 2012
  2. [PATCHv3] git-p4: add initial support for RCS keywordsLuke Diamand, Feb 14, 2012
  3. Junio C HamanoFeb 14, 2012
  4. Pete WyckoffFeb 21, 2012
  5. Eric ScoutenFeb 21, 2012
  6. Junio C HamanoFeb 21, 2012
  7. Eric ScoutenFeb 21, 2012

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.