$Id lines

Rainer Müller raimue at macports.org
Fri Dec 4 03:57:53 PST 2015


On 2015-12-04 11:14, René J.V. Bertin wrote:
> If I understood correctly, the $Id lines in Portfiles (and PortGroup
> and other (?) files) are rewritten at each svn commit. If that's
> correct, it shouldn't be an issue if someone who uses a VCS for
> his/her local development port repository were to do the same,
> right?

Subversion expands the $Id$ keywords only in your local working copy.
The committed version in the repository only contains the literal string
"$Id$" (you can even see this if you look at the repository over HTTP
instead of using the svn client). Only third-party Subversion clients
such as git-svn are known to break this policy and commit expanded
keywords [1].

However, I doubt the $Id$ lines are really helpful. On my agenda for
supporting git-svn for development [2], I also proposed to just remove
the svn:keywords property completely [3].

> Does anyone know how to implement such a rewriting feature with git,
> as a pre-commit step I presume (or else the files will always remain
> in modified state)?

While git itself does not support keyword expansion, you may be able to
achieve similar results using git attributes [4].

Rainer

[1] http://trac.macports.org/ticket/38902
[2] https://trac.macports.org/wiki/WorkingWithGitSVN
[3]
https://lists.macosforge.org/pipermail/macports-dev/2014-March/026151.html
[4]
https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#Keyword-Expansion


More information about the macports-dev mailing list