From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?UmVuw6kgU2NoYXJmZQ==?= Subject: Re: Commit ID in exported Tar Ball Date: Wed, 23 May 2007 01:44:37 +0200 Message-ID: <46538065.9080705@lsrfire.ath.cx> References: <20070517163803.GE4095@cip.informatik.uni-erlangen.de> <200705171857.22891.johan@herland.net> <20070517171150.GL5272@planck.djpig.de> <464F5CA2.3070809@lsrfire.ath.cx> <7vd50wv88t.fsf@assigned-by-dhcp.cox.net> <20070520035752.GG3141@spearce.org> <46502EF7.6000708@lsrfire.ath.cx> <20070521060231.GI3141@spearce.org> <4651F908.2000608@lsrfire.ath.cx> <46536E32.6000202@lsrfire.ath.cx> <7vd50s79lg.fsf@assigned-by-dhcp.cox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "Shawn O. Pearce" , git@vger.kernel.org, Frank Lichtenheld , Johan Herland , Thomas Glanzmann , Michael Gernoth , Linus Torvalds To: Junio C Hamano X-From: git-owner@vger.kernel.org Wed May 23 01:45:15 2007 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hqe2O-0000PR-WC for gcvg-git@gmane.org; Wed, 23 May 2007 01:45:09 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758288AbXEVXoq convert rfc822-to-quoted-printable (ORCPT ); Tue, 22 May 2007 19:44:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758308AbXEVXoq (ORCPT ); Tue, 22 May 2007 19:44:46 -0400 Received: from static-ip-217-172-187-230.inaddr.intergenia.de ([217.172.187.230]:59473 "EHLO neapel230.server4you.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758288AbXEVXop (ORCPT ); Tue, 22 May 2007 19:44:45 -0400 Received: from [10.0.1.201] (p508e4968.dip.t-dialin.net [80.142.73.104]) by neapel230.server4you.de (Postfix) with ESMTP id 52AEF2F007; Wed, 23 May 2007 01:44:43 +0200 (CEST) User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) In-Reply-To: <7vd50s79lg.fsf@assigned-by-dhcp.cox.net> Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: Junio C Hamano schrieb: > Ren=C3=A9 Scharfe writes: >=20 >> OK, so here's a first shot at the mentioned parser. It only underst= ands >> @@COMMITID@@ and @@@@, but it's easily extendible. The internals of >> git-describe would need to be converted to library functions, prefer= ably >> offering every piece of version info separately (see thread "[PATCH] >> Make sure an autogenerated version has at least four parts" for why)= =2E >> >> Before doing that, we should determine if this is the way to, though= =2E >> >> Ren=C3=A9 >=20 > Hmmm. I am torn. >=20 > It almost feels as if we'd better bite the bullet and do more > insane things in ident substitution, instead of introducing this > apparent syntax inconsistency between "$id$" and "@@COMMITID@@". $Id$ (and $commit$) is reversible, @@COMMITID@@ is not. That means you can create a synthetic file byte for byte with @@COMMITID@@ (and its no= t yet implemented brethren), but you can't do that with $Id$ -- it's impossible to get rid of the dollar signs. I'm not attached to any particular syntax. It all started with @@VERSION@@ from git.spec.in, which should not be implemented 1:1 anywa= y (we'd need to be able to use arbitrary separators between version parts to support different ways of ordering version numbers). We could use $ to indicate reversible substitutions as before and @ (instead of @@) for one-way substitutions. I can't think of any other use than in archives, though. It sure would be very confusing to have such a conversion happen on checkout -- you'd need to use git-cat-file to see the real file contents. > That is, we could (I am not seriously proposing to do this, as I > expect this will lead to a lot of insanity at the end): >=20 > (1) introduce "const unsigned char commit_in_focus[20]", > globally available to git suite, and clear it at the > beginning of main(); Ugh. Requiring another global variable doesn't smell like good design. By the way, we already have a similar, but very different syntax: the one format_commit_message in commit.c. It's a one-way conversion, too. Maybe we should copy the relevant pieces like %H and %h from there.. Do we want git-archive specific one-way conversions that are capable of creating files like git.spec? Or is this just a shiny toy hypnotizing me? 8-) Ren=C3=A9