<p>I recently asked about <a href="https://stackoverflow.com/questions/39742/does-git-have-anything-like-svn-propset-svnkeywords-or-pre-post-commit-hooks">keyword expansion in Git</a> and I'm willing to accept the design not to really support this idea in Git. </p>

<p>For better or worse, the project I'm working on at the moment requires SVN keyword expansion like this:</p>

<pre><code>svn propset svn:keywords "Id" expl3.dtx
</code></pre>

<p>to keep this string up-to-date:</p>

<pre><code>$Id: expl3.dtx 803 2008-09-11 14:01:58Z will $
</code></pre>

<p>But I would quite like to use Git to do my version control. Unfortunately, git-svn doesn't support this, according to the docs:</p>

<blockquote>
  <p>"We ignore all SVN properties except svn:executable"</p>
</blockquote>

<p>But it doesn't seem too tricky to have this keyword stuff emulated by a couple of pre/post commit hooks. Am I the first person to want this? Does anyone have some code to do this?</p>

You could set the ident attribute on your files, but that would produce strings like
```
```
$Id: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef$
```
```
where
```
deadbeef...
```
is the sha1 of the blob corresponding to that file. If you really need that keyword expansion, and you need it in the git repo (as opposed to an exported archive), I think you're going to have to go with the
```
ident
```
gitattribute with a custom script that does the expansion for you. The problem with just using a hook is then the file in the working tree wouldn't match the index, and git would think it's been modified.