git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Could GIT manage revision headers embedded in code ?

From
Christian Couder <christian.couder@gmail.com>
Date
May 2, 2017, 12:11 UTC
Message-ID
<CAP8UFD0NrTyGYgHeEOWpUH5v0ejKvcKu+Mzd8_scYbvzL4b4zg@mail.gmail.com>
In-Reply-To
<135C7A92C7D64E488B830ADC2970C70132AE6407@SVGEA-EMAIL.gea.fr>
Hi,
On Tue, May 2, 2017 at 1:48 PM, Delanoe Eric <e.delanoe@gea.fr> wrote:
Show 8 quoted lines
> Hello,
>
> We need a great deal of traceability for our source, made of many scripts in interpreted languages, spread in many "independent" modules, as far as can be ;-).
> In particular, somebody troubleshooting a script in production should be able to know exactly the revision or commit ID (or tag label) of a given file, and its location in the GIT source directory tree.
>
> Our old CVS... let's say it was its only advantage... was doing this with keywords embedded in code comments: $Header$, $Id$, $Rev$, $File$ etc... When a file was committed, its $Header$ keyword was expanded into a rich piece of "version" information like '' $Header: /cvsstore/SourcesOracle/Install/COMMUN/CST.sql,v 1.69.2.10 2017/04/14 09:38:48 edelanoe $".
>
> Could this kind of "keyword expansion" feature be added into GIT ?

You can already do it with "smudge" and "clean" filters. Look for "Keyword Expansion" in:

https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes
Previous: Delanoe EricNext: Delanoe Eric
Message 2 of 4 in “Could GIT manage revision headers embedded in code ?”
  1. Delanoe EricMay 2, 2017
  2. Christian CouderMay 2, 2017
  3. Delanoe EricMay 2, 2017
  4. Johannes SchindelinMay 2, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.