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

RE: [PATCH] issue 1780: Keyword values with dollar signs causebadness.

From: Lieven Govaerts <lgo_at_mobsol.be>
Date: 2006-01-10 21:07:13 CET

Michael, John,

> John Peacock wrote:
> Michael Pilato wrote:
> > The algorithm is a pretty good one, though I think it still
> falls down
> > if, say, an Author's name begins with a '$'. The expanded
> form would
> > be '$ Author: $username $', which happens to be a superset of the
> > completely valid format '$ Author: $'.

You're absolutely right, this patch doesn't solve that situation, it will
give the same result as the code without the patch.

> Which brings up the topic of a generalized escaping mechanism
> for keyword *values*, rather than trying larger and larger
> strings (as the proposed patch does).

Yep, that's the choice between one step closer to handling the most common
situations, or providing a definitive but incompatible solution.

The situation that I encounter the most is that people use a $ sign in the
middle of the filenames, not at the beginning or the end. My patch solves
that scenario just fine.

Concerning performance, a keyword is not only limited by SVN_KEYWORD_MAX_LEN
chars, but also by a '\r' or '\n'. So the only scenario where the
performance is affected by this patch is with:
  - a file with keyword expasion enabled
  - containing very long lines without CR's
  - using filenames with $ signs.

And even then, SVN_KEYWORD_MAX_LEN is defined as 255 for now, it will never
exceed eg. 1024 right?

I'm willing to discuss and implement and alternative solution btw, but
anything that we come up with has to be implemented so it can parse both
current and new types of keyword expansion.

We can use double quotes to contain the keyword values:

$Date: "2002-07-22 21:42:37 -0700 (Mon, 22 Jul 2002)" $
$Id: "calc.c 148 2002-07-28 21:30:43Z sally" $
$HeadURL: "http://svn.collab.net/repos/trunk/README" $
$Revision: "144" $

Easy to implement and clear for the users. The only people that will be
affected are those that actually use these values in code instead of as


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.16/225 - Release Date: 9/01/2006
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jan 10 21:11:02 2006

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.