gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Keyword substitution, How can I automatically add v


From: John Arbash Meinel
Subject: Re: [Gnu-arch-users] Keyword substitution, How can I automatically add version to file?
Date: Wed, 19 Jan 2005 10:09:23 -0600
User-agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)

Jan Hudec wrote:

On Tue, Jan 18, 2005 at 21:39:50 +0100, Juraj Kubelka wrote:


Hi!

I need add something like $Id$ from CVS to file and automatically
update it before commit to new version.



That's not possible. It is too complicated to handle this in mergeing to
be worth the trouble. Especialy since tla relies on external diff/patch,
that can't easily be given special hooks.



I have to agree. I've used the CVS $Id$ and if you ever have to do any
merging, you get conflicts all over the place (even with CVS). svn is
supposedly better in that they store the unexpanded form in the
repository, and only expand after everything is done, but that is a lot
of work to make sure you don't do bad things.

I personally use a version file which is generated with every build.
(version.hpp, version.cpp). It includes the short form of the version
(0.7) and the long form (address@hidden/cat--branch--0.7--patch-23).

If you really wanted, you could easily bind to the post-commit hook (I
think this is just "commit"), and re-generate the file then. I take the
above approach because I also check to see if there are any uncommitted
changes, and if so, I add a "+" to the end of the revision form.

Having the string allows me to compile in the version of the tree, such
that at runtime you can ask the program what version/revision it is.

The really nice thing is that you only need 1 of these to completely
define the entire project tree. One of the problems with CVS $Id$ is
that it only defines the version of *that* file. If you wanted to
runtime query the program, you technically need the $Id$ from *every*
file so that you can truly qualify what went into the program. When I
had to do it in the past with CVS, I used $Name$ and then you have to do
special checkouts to get that expanded (I think -kkv or something, it's
been a while). `tla logs -rf | head -1` is much simpler.

Now, if you are saying that you need $Id$ because you are giving the
source out to people, but stripping the {arch} directory, I still
advocate the version file, since again, it can define the entire tree,
rather than just one or two files.

John
=:->

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]