Reg : Keyword expansion

Mike Meyer mwm at mired.org
Wed Aug 25 20:23:29 UTC 2010


On Wed, 25 Aug 2010 11:42:49 -0500
Matt Mackall <mpm at selenic.com> wrote:

> On Wed, 2010-08-25 at 06:05 -0700, Petchimuthu wrote:
> >         Can u tell me some guidelines about keyword ( $Id:$ ) expansion in
> > mercurial? 
> My guideline is: don't use keywords. Keywords are a bad idea that we'd
> really like to leave in the 80s. This is why keywords is an extension
> and intentionally left out of Mercurial's core.

Given that they generally cause more problems than they solve these
days, this is good advice.

> In fact, you'll note that Git and Bzr -also- intentionally left this
> feature out. That's three modern, independently designed systems that
> all thought keywords were a bad idea.

For that matter, the second and third generation CVCS systems like
subversion and perforce started in that direction: while they support
keyword expansion, you have to turn it on on a per-file basis. That
makes five independently designed systems that discourage their use.

The workflows in use when RCS introduced keyword expansion made them
convenient. Since then, the tools have gotten a lot smarter, and
workflows have generally altered to take advantage of that, so that
the downsides of keywords outweigh the convenience they offer.

In RCS, keywords were the only way to mark files. In pretty much
everything since then, the VCS will let you mark sets of files -
either at specific revisions or as a line of development - and work
with those sets. Without introducing the spurious differences and
resulting extra work that plague keyword expansion.

	<mike
-- 
Mike Meyer <mwm at mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



More information about the Mercurial mailing list