[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: CVS $Log$ equivalent in Subversion?

From: C.A.T.Magic <c.a.t.magic_at_gmx.at>
Date: 2004-03-10 00:19:50 CET

----- Original Message -----
From: "Bob Bradley" <bob@chaoticsoftware.com>
To: "C. Michael Pilato" <cmpilato@collab.net>
Cc: <users@subversion.tigris.org>
Sent: Tuesday, March 09, 2004 22:57
Subject: Re: CVS $Log$ equivalent in Subversion?

> On 3/9/04 7:53 AM, "C. Michael Pilato" <cmpilato@collab.net> wrote:
>
> > IIRC, $Log$ has been decreed evil because of the recursion problem
> > that occurs when you actually use the character sequence "$Log$" in a
> > log message, as in "I added the $Log$ keyword to the top of this
> > file."
>
> It doesn't seem unreasonable to me to require the user to not use $Log$ in
> log messages if $Log$ is being used. There are also other ways to solve
this
> more cleanly than the way CVS does it. For example, you could have
something
> like $LogEnd$ that stops $Log$ expansion after it is found and doesn't do
> $Log$ expansion inside a $Log$ .. $LogEnd$ block. $LogEnd$ could have a
> similar recursion effect, but it would tend to be benign because it would
> just stop expanding earlier than it should, which is most likely fine. An
> even simpler way (just off the top of my head) would be something like
> "$Log-Once$ (probably needs a better name) to stop expanding after it.
>
> Something more general that I've also found useful is something like
> $EndKeywords$. I added this to CVS (but I never raw a response to my
patch)
> so scripts that parsed files with keywords (and therefore had keywords as
> part of their content) didn't get expanded after $EndKeywords$ was found.
> This allowed me to have a header at the top with keywords expanded while
the
> text below was protected from expansion.

In the case of $Log ...$ and $Id ...$ the endmarker is
a single character, the $ sign.

So I can only think of 3 solutions to that problem:

  1) disallow the '$' character inside of keywords.

  2) escape the '$' character inside of keywords as \$.

  3) use a start and end marker that is guaranteed to not-appear
       inside the $..$ marker.
       emails use this method to split parts of a mail like
             Content-Type: multipart/mixed;
                boundary="----_=_NextPart_000_01C4061E.27AAB160"
       (just an example copied from some email - the marker could
        ofcourse be shorter/nicer)

      *) If a user accidentally duplicates the line with the "boundary"
          marker, or deletes it, spit out an error and don't allow commit.

I think solution 1) or 2) go well with the smaller keywords like $Id$ and
$Author$,
while 3) could be a safe solution for large blocks like $log...$.

Also note that if svn would support $log$ it should also prevent/warn users
from
making modifications to older log messages. Somewhere I've read that
users tend to try to correct typos inside of old $log$ entries etc.

another EUR 0.2
:-)
c.a.t.

P.S.: svn already has some similar issues with spaces in/and long usernames
:-)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Mar 10 00:20:12 2004

This is an archived mail posted to the Subversion Users mailing list.