关联文件中新发行版本的版本号(文档) [英] Bumping version numbers for new releases in associated files (documentation)

查看:114
本文介绍了关联文件中新发行版本的版本号(文档)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很想知道您在那里如何处理提高版本号的新发行版.

I would be interested to in knowing how you out there handle the bumping the version number for new releases issue.

如何处理相关文件(例如手册页等)中的版本号.

How do you handle the version number in associated files like man pages, etc.

该软件是使用gnu工具链构建的,因此可以使用autoconf,automake等并将其用作应用程序的版本号.这样就可以重用信息.

The software is build with the gnu tool chain so autoconf, automake, etc are available and used for the version number of the application. So that information can be reused.

git用作vcs.

一种可能性是在Makefile.am中引入一个新的目标,该目标执行sed/awk替换所有关联文件中的版本号和日期.可以在开发新版本的开始(分支之后)一次调用该目标.

One possibility would be introduce an extra, new target in Makefile.am that does a sed/awk to replace version number and dates in all associated files. That target could be called once at the beginning (right after branching) of the development of a new release.

然后,当人们对项目进行 git克隆或完成发行包时,可以使用正确的信息来构建项目.当然,在开始开发新版本时,必须记住要运行此make目标.

Then the project could build with the correct information when people would do a git clone of the project or when a release tarball is done. Of course one has to remember to run this make target when starting development of a new release.

另一种选择是使用dist目标的钩子进行sed/awk替换,但这将使项目的git存储库处于未与关联文件关联正确版本号的状态.

Another option would be to do the sed/awk replacement with a hook for the dist target.But this would put the git repository of the project in a state were no correct version number is associated with the associated files.

我更喜欢执行第一个解决方案,因为它还会在git历史记录中记录正确版本号.

I prefer doing the first solution as it also records the correct version number inside the git history.

当执行sed/awk替换时,您更喜欢在文件内"执行还是使用模板文件内的方式执行autoconf/automake工具.我同时看到了两种方法的优点和缺点.

When doing a sed/awk replacement do you prefer doing it "in-file" or with a template in-file liek the autoconf/automake tools do. I see both advantages and disadvantages in both methods.

如何处理关联文件的版本.您是在开发阶段的开始更改它们吗?在发运之前更改它们吗?是否要进行文件内替换?还是希望使用模板?

How do you handle versioning of associated files. Do you change them at the beginning of the development phase, do you change them when just before shipping, do you do infile replacement or do you prefer using a template?

THX.

推荐答案

我认为,执行此操作的标准方法是使用Git的hook系统和m4或sed/awk进行搜索/替换(如您所建议).您只需要在每个文件的注释中加上特殊的标记(可能在标题中)即可.

I think that the standard way to do this is to use Git's hook system and m4 or sed/awk to do the search/replace as you suggest. You just need a special token with in a comment in each file (probably in the header).

以下是 githooks 上的参考,下面是解决相同问题的人们写的几页:

Here's the reference on githooks and here's a few pages written by people solving the same problem:

  • http://groups.google.com/group/memcached/browse_thread/thread/b02e992ede0f0e89
  • http://blog.rfwatson.net/2009/06/03/automatic-version-numbering-using-git/

这两种方法都依赖于将版本号存储在源代码树中某个位置的文件中.

Both of these rely on storing the version number in a file somewhere in your source tree.

我还碰到了一个叫做 0release 的照片,它声称可以自动创建发布(并设置版本号) ).

I also came across a took called 0release that claims to automate release creation (and setting version numbers).

最后,关于发布号,还有其他几个问题可以解决:

Finally, regarding release numbers, this is addressed in several other questions:

  • What version numbering scheme do you recommend?
  • How do you do version numbering in an agile project?
  • What version number scheme for poorly planned, branched, and schizophrenic application
  • And more https://stackoverflow.com/search?q=release+numbering

这篇关于关联文件中新发行版本的版本号(文档)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆