Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>RCS keyword substitution is not natively supported by Git, but can be added with a <code>gitattributes</code> filter driver: See "<a href="https://stackoverflow.com/questions/2059326/git-equivalent-of-subversions-url-keyword-expansion">Git equivalent of subversion's $URL$ keyword expansion</a>".</p> <p><img src="https://git-scm.com/book/en/v2/images/smudge.png" alt="alt text"></p> <p>For example (not <em>exactly</em> relate to your question, but illustrates the general principle):</p> <pre><code>git config filter.rcs-keyword.clean 'perl -pe "s/\\\$Date[^\\\$]*\\\$/\\\$Date\\\$/"' git config filter.rcs-keyword.smudge 'perl -pe "s/\\\$Date[^\\\$]*\\\$/\\\$Date: `date`\\\$/"' </code></pre> <p>You will base your filter script on the result of <code>git describe --tags</code> called from your Makefile.</p> <p>As mentioned in <a href="https://stackoverflow.com/questions/2059326/git-equivalent-of-subversions-url-keyword-expansion/2059393#2059393">this answer</a> to "Git equivalent of subversion's $URL$ keyword expansion", smudge/clear filter driver is not a perfect solution, and adding any kind of meta-data directly in the data (source) is <a href="https://stackoverflow.com/questions/1127177/to-put-the-prefix-revision-number-to-codes-by-git-svn/1127241#1127241">generally a bad idea</a> (you have a debate about it in "<a href="https://stackoverflow.com/questions/645008/what-are-the-basic-clearcase-concepts-every-developer-should-know/645424#645424">What are the basic clearcase concepts every developer should know?</a>").</p> <p>Yet you have a good example of such Git <strong>keyword expansion</strong> in <a href="https://stackoverflow.com/questions/1792838/enable-ident-string-for-git-repos/1796675#1796675">this answer</a> in "How do I enable ident string for Git repos?".</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload