$id: name of file, date/time creation Exp $

2020-06-16 02:12发布

Frequently I come across the following statements in C/C++ source code:

$Id: lzio.c,v 1.24 2003/03/20 16:00:56 roberto Exp $

$Id: file name, version, timestamp, creator Exp $

Have you got any idea which software produces those "signatures"?

5条回答
放荡不羁爱自由
2楼-- · 2020-06-16 02:20

I've seen a few vim setups that will auto-magically populate these values. SVN can grab these values on pre and post commit hooks to fill default information in commit logs.

查看更多
别忘想泡老子
3楼-- · 2020-06-16 02:33

Keyword substitution in subversion produces this sort of information, in particular Id:

Id

This keyword is a compressed combination of the other keywords. Its substitution looks something like $Id: calc.c 148 2006-07-28 21:30:43Z sally $, and is interpreted to mean that the file calc.c was last changed in revision 148 on the evening of July 28, 2006 by the user sally.

You can tell subversion to insert these values using svn:keywords

To tell Subversion whether or not to substitute keywords on a particular file, we again turn to the property-related subcommands. The svn:keywords property, when set on a versioned file, controls which keywords will be substituted on that file. The value is a space-delimited list of the keyword names or aliases found in the previous table

You can also make these substitutions automatic by editing your config:

Subversion also provides the auto-props feature, which allows you to create mappings of filename patterns to property names and values. These mappings are made in your runtime configuration area. They again affect adds and imports, and not only can override any default MIME type decision made by Subversion during those operations, they can also set additional Subversion or custom properties, too. For example, you might create a mapping that says that any time you add JPEG files—ones that match the pattern *.jpg—Subversion should automatically set the svn:mime-type property on those files to image/jpeg. Or perhaps any files that match *.cpp should have svn:eol-style set to native, and svn:keywords set to Id. Auto-prop support is perhaps the handiest property related tool in the Subversion toolbox. See the section called “Config” for more about configuring that support.

查看更多
The star\"
4楼-- · 2020-06-16 02:37

Perforce supports some (not sure about all) of those key words.

查看更多
来,给爷笑一个
5楼-- · 2020-06-16 02:40

Version control systems such as CVS can produce such tags.

查看更多
Ridiculous、
6楼-- · 2020-06-16 02:45

Both RCS and CVS produce strings that look exactly like that.

查看更多
登录 后发表回答