Received: from spf3.us4.outblaze.com (spf3.us4.outblaze.com [205.158.62.25]) by sdf.lonestar.org (8.12.10/8.12.10) with ESMTP id j0J9sB55010871 for ; Wed, 19 Jan 2005 09:54:12 GMT Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by spf3.us4.outblaze.com (Postfix) with ESMTP id 4549553B3C for ; Wed, 19 Jan 2005 09:54:36 +0000 (GMT) Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CrCjp-0000wT-0e for migo@homemail.com; Wed, 19 Jan 2005 05:06:57 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CrCe8-00005e-RR for gnu-arch-users@gnu.org; Wed, 19 Jan 2005 05:01:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CrCe7-00005K-H2 for gnu-arch-users@gnu.org; Wed, 19 Jan 2005 05:01:04 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CrCco-00087y-6A for gnu-arch-users@gnu.org; Wed, 19 Jan 2005 04:59:42 -0500 Received: from [212.71.168.94] (helo=vagabond.light.src) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CrC88-0008KZ-PE for gnu-arch-users@gnu.org; Wed, 19 Jan 2005 04:28:01 -0500 Received: from bulb by vagabond.light.src with local (Exim 3.36 #1 (Debian)) id 1CrC1x-0001nu-00; Wed, 19 Jan 2005 10:21:37 +0100 Date: Wed, 19 Jan 2005 10:21:37 +0100 From: Jan Hudec To: Juraj Kubelka Subject: Re: [Gnu-arch-users] Keyword substitution, How can I automatically add version to file? Message-ID: <20050119092137.GB6310@vagabond> References: <20050118203950.GA14564@cesta> Mime-Version: 1.0 In-Reply-To: <20050118203950.GA14564@cesta> User-Agent: Mutt/1.5.6+20040907i Cc: gnu-arch-users@gnu.org X-BeenThere: gnu-arch-users@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: a discussion list for all things arch-ish List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============2043924233==" Sender: gnu-arch-users-bounces+migo=homemail.com@gnu.org Errors-To: gnu-arch-users-bounces+migo=homemail.com@gnu.org Status: RO Content-Length: 3785 Lines: 109 --===============2043924233== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xXmbgvnjoT4axfJE" Content-Disposition: inline --xXmbgvnjoT4axfJE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 18, 2005 at 21:39:50 +0100, Juraj Kubelka wrote: > Hi! >=20 > 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 read it is not possible with GNU Arch (tla). Do you think I can use > hook file? But how? When `$1 =3D=3D commit' it is too late for updating > and when `$1 =3D=3D precommit' it hasn't any effect. It is added to file > but not committed. Also I have to execute `touch file' and then `tla > changes --diffs' shows me not added difference (line). You do NOT want to commit that information! That would produce bogus conflicts! > Do you have better idea? I need it because of tagging builds (binary > files). I need to know relation between binaries in sources and it > isn't good depend on human factor. There are two options. Either you can have a precious (ie. not commited but always preserved) file, that will be updated in hooks after replay, update, star-merge and get. Unfortunately I am not sure the hooks are there (and I fear they are not). However, if you use build-config, it creates a file called =3DRELEASE-ID with precisely this information. There is another possibility, that I'd consider best. In fact I have already used that several times. Just find that information dynamicaly during build! I will assume that you want to set the information in configure script, so shell assignment is the right way. If it's something else, modify appropriately. Basicaly the trick is to call: VERSION=3D`tla logs -f -r | head -1` (you can of course add decorations...: VERSION=3D"arch-version: `tla logs -f -r | head -1`" ) If you wanted to do this from make instead, you would write: VERSION=3D"-DVERSION=3D\"`tla logs -f -r | head -1`\"" and then just expand $(VERSION) on the build command. If you want to keep the version after the arch information is stripped (like for a release), than just make a script or build target, that creates this version, that will write the information is some file during the process. > Can this tag line cause any branch merging problem? When every release > in every branch has unique this line in file? I talk about line like: Sure. It will always cause a conflict. Which is a reason why it was not implemented. The workarounds mentioned above were good enough for everybody so far so that nobody cared enough to define and implement keyword substitution. ---------------------------------------------------------------------------= ---- Jan 'Bulb' Hudec --xXmbgvnjoT4axfJE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFB7iahRel1vVwhjGURAubwAJ9NxcwG0/AVUevLag53rsHT1LT6qQCg3akc LiKDSCDMqnsoB4YVUf/ft30= =69+L -----END PGP SIGNATURE----- --xXmbgvnjoT4axfJE-- --===============2043924233== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Gnu-arch-users mailing list Gnu-arch-users@gnu.org http://lists.gnu.org/mailman/listinfo/gnu-arch-users GNU arch home page: http://savannah.gnu.org/projects/gnu-arch/ --===============2043924233==--