有没有办法在 SVN 中生成变更日志

发布于 2024-07-04 18:30:34 字数 444 浏览 5 评论 0原文

当提交到 SVN 时,我可以添加顶级提交消息来详细说明正在提交的内容,但我理想情况下希望有一种方法来评论各个文件以及其中发生的更改。 我在以前的工作中见过类似的东西,但这是使用 CVS (我不记得这是否是通过家庭酿造脚本来生成框架文件来实现的)

我已经查看了更改列表,但我再次不认为(尽管我愿意被证明是错误的)这给出了如下所述的粒度。

理想情况下,我正在寻找类似的东西:

Foo.vb

  • 添加了新的功能栏

Bar.vb

  • 删除了函数 foo
  • 在 xyz 中添加了执行 abc 的功能 +/- 修改了记录错误的函数

When commiting to SVN I can add a top level commit message to detail what is being committed, but I would ideally like a means to comment on the individual files and what has changed within them. I have seen something similar in previous employment, but this was using CVS (and I can't recall whether this was achieved with a home brew script to produce the skeleton file)

I have had a look at changelists but again I don't think (although i am willing to be proved wrong) that this gives the kind of granularity as outlined below.

Ideally I am looking for something along the lines of:

Foo.vb

  • Added new function bar

Bar.vb

  • Removed function foo
  • Added functionality in xyz to do abc
    +/- Modified function to log error

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

浪推晚风 2024-07-11 18:30:34

如果存在一些关于在每个提交的文件中写入注释的方式的规则,则可以获得这种结果。 之后可以通过 svn 触发器提取这些注释。

That kind of result could be obtain if there is some rules regarding the way comments are written inside each of the committed files. These comments can after that be extracted by a svn trigger.

十年不长 2024-07-11 18:30:34

我编写了一个用于执行此类操作的项目,名为 MOAP

它的功能之一是从本地 diff 生成 ChangeLog 条目(当前支持 bazaar、cvs、svn、git 和 darcs)。 您可以通过运行“moapchangelogprep”或“moapclprep”来完成此操作。如果启用该选项,该条目也可以包含更改的功能。

然后,您去更改该条目,并描述您的更改。 您可以删除不想在下次提交时提交的文件。

然后,您可以运行“moap changelog commit”来提交 ChangeLog 条目中描述的更改。 它只会提交那里列出的文件,并将所有其他更改保留在本地。

希望有帮助!

I've written a project for doing this kind of thing called MOAP

One of its functions is to generate a ChangeLog entry from your local diff (currently supporting bazaar, cvs, svn, git and darcs). You do this by running 'moap changelog prepare' or 'moap cl prep' That entry can include functions changed as well if you enable the option.

You then go and change that entry, describing your changes. You can remove files you don't want commited as part of your next commit.

Then, you can run 'moap changelog commit' to commit the changes described in the ChangeLog entry. It will only commit the files listed there, and leave all your other changes local.

Hope that helps!

秋叶绚丽 2024-07-11 18:30:34

我只会在个人提交消息中执行此操作。 TortoiseSVN 具有文件名自动完成功能,因此对此有很大帮助。

您可以做的另一件事是在提交之前执行 svn st 并将文件名复制/粘贴到提交消息中。

哦,一定要强烈质疑它的价值。 我知道一些 OSS 项目(Linux?)需要这种保真度,但对于许多项目来说这只是噪音。 Diff 可以告诉您的信息远不止这些,而且更准确。

您可能需要考虑的另一件事是使用 Git。 Git 允许您以较小的步骤在本地提交。 然后,您将所有提交单独推送到主服务器,或者将所有提交消息压缩到单个提交中,并在单个消息中包含所有提交消息。 这是一种简化的解释,但可能值得一看。

I would just do this in the individual commit message. TortoiseSVN has filename autocompletion so that greatly aids in this.

Another thing you could do is svn st before you commit and copy/paste the filenames into your commit message.

Oh, and be sure to strongly question the value of this. I know some OSS projects (linux?) require this sort of fidelity, but for many projects this is just noise. Diff can tell you much more than this, and more accurately.

One other thing you may want to consider is using Git. Git allows you to commit locally, in smaller steps. You then push to the master server all of your commits individually or squashed into a single commit w/ all the commit messages in a single message. That was a way simplified explanation, but it probably is worth checking out.

飞烟轻若梦 2024-07-11 18:30:34

SVN 和 CVS 之间的本质区别之一是更改是原子提交的。 在 CVS 中,每个文件都有自己的版本,但在 SVN 中,版本适用于整个项目,包括一起签入的所有文件。

以下是解决方案的四个想法:

  1. 分别签入每个程序,并使用其自己的日志消息。 这可能意味着,如果您签入五个文件,您将“用完”五个版本,其中四个可能会导致构建损坏。
  2. 在单独的路径(即您自己的私有分支)上进行开发,如上所述,然后在战略时刻将您的分支合并到主干。
  3. 一起检查所有内容,并将各个记录作为注释保留在程序标题中。 这可能意味着(一点)额外的工作,但无论如何您都必须编写单独的登录消息。
  4. 对所有文件进行一次签入,但使用完整的日志消息详细说明每个文件的每个部分。

One of the essential differences between SVN and CVS is that changes are committed atomically. In CVS each file has its own version, but in SVN the version is for the whole project and includes all the files checked in together.

Here are four ideas for a solution:

  1. Check in each of your programs separately, with its own log message. This may mean that if, say, you check in five files, you will "use up" five versions, of which four may result in a broken build.
  2. Do your development on a separate path (i.e. your own private branch), do as above, then at strategic moments merge your branch to the trunk.
  3. Check in everything together, and keep the individual records as comments in the program header. This may mean (a little) extra work, but you'd have to compose the individual login messages anyway.
  4. Do a single checkin for all the files, but with a nice full log message detailing each piece for each file.
谈情不如逗狗 2024-07-11 18:30:34

每当你完成一项特定任务时,你就可以承诺。 无论如何,这应该会带来更好的评论。 关于三个必要文件的“已实现电子邮件验证”的评论告诉我的不仅仅是“添加的功能 verify_email”。 我自己可以在差异中看到后者。

You could just commit whenever you're done with one particular task. That should lead to better comments anyway. A comment reading "Implemented E-Mail verification" on the three files necessary tells me a lot more than "added function verify_email". I can see the latter myself in the diff.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文