Version control Emacs:有没有办法从diff生成骨架变更日志?

Version control Emacs:有没有办法从diff生成骨架变更日志?,version-control,emacs,elisp,changelog,Version Control,Emacs,Elisp,Changelog,在版本控制中使用源代码时,我想部分自动创建GNU风格的变更日志条目。addchangelogentryother窗口一次只能处理一个文件,您必须访问该文件才能使用它 相反,我希望看到的是有一些命令可以获得diff-u-p的输出(或者与VC模式集成,以便它可以处理svn diff等),并一次创建所有骨架条目 例如,如果显示svn状态 D file1.c M file2.c A file3.c 命令将创建 2009-09-05 My Name <my.email> *

在版本控制中使用源代码时,我想部分自动创建GNU风格的变更日志条目。
addchangelogentryother窗口
一次只能处理一个文件,您必须访问该文件才能使用它

相反,我希望看到的是有一些命令可以获得
diff-u-p
的输出(或者与VC模式集成,以便它可以处理
svn diff
等),并一次创建所有骨架条目

例如,如果显示
svn状态

D file1.c
M file2.c
A file3.c
命令将创建

2009-09-05  My Name <my.email>

      * file1.c: Removed.
      * file2.c: WRITE YOUR CHANGES HERE
      * file3.c: New.
我已经找到了,但我不知道如何在这里应用它

有什么建议吗?谢谢

编辑:建议一个答案。不幸的是,它只支持CVS,并且通过查询已经提交的VC日志来创建ChangeLog条目。因此,即使它支持svn和其他,也不可能在同一个提交中提交更改和变更日志


EDIT2:显然,添加changelog条目到其他窗口(C-x4a)不仅可以从访问的文件中工作,还可以从涉及该文件的diff hunk中工作。这几乎就是我要找的。这与elisp循环一起迭代所有大块头应该可以解决这个问题。

我不知道有哪个函数可以做到这一点,但它应该很容易实现。基本上,你想

  • 获取更改的文件
  • 对于每个文件,请调用
    addchangelog

make magic change log entry
只需执行
add change log
函数,这样唯一的参数就是
文件名
-您可以设置其他参数。

有一个函数可以从版本控制日志项中自动生成更改日志项。

我编写了一个函数来做一些事情和你说的差不多。您可以在

diff add change log entries(差异添加更改日志条目)中获取代码。其他窗口
被记录下来,以执行您在EDIT2中提到的操作:

diff-add-change-log-entries-other-window is an interactive compiled
Lisp function in `diff-mode.el'.

(diff-add-change-log-entries-other-window)

Iterate through the current diff and create ChangeLog entries.
I.e. like `add-change-log-entry-other-window' but applied to all hunks.
不幸的是,它不能很好地用于(比如)新文件:它甚至没有在骨架更改日志条目中包含这些文件的文件名


您可能会更幸运地使用gcc的mklog脚本,您可以从中获得该脚本。

我认为跟踪函数级别的更改将是一件棘手的事情。jinxed_编码器:毫无疑问。那更像是“天上的馅饼”的愿望。另一方面,它不必100%完美。谢谢。我想这将排除删除和添加的文件?取决于您如何生成更改的文件列表。您可以做很多事情,比如让列表成为一个cons对列表(“列表”),比如(“添加的”。“文件名”)。如果您想做更多的魔术,您可以创建一个新的定制的addchange日志条目,其中包含您想要的任何其他内容的参数。要做的事情是读取add-log.el代码。对不起,这不是我要找的。首先,它只支持CVS。即使它支持其他VC系统,它也会从VC日志条目中创建ChangeLog条目,这意味着已提交更改的文件。当然,这对CVS来说没问题,但是对于任何21世纪的版本控制系统,我希望将变更日志提交到与更改文件本身相同的变更集中。没错,我没有检查psvn或git/magit是否实现了此功能,对此表示抱歉。谢谢!最后我试了试。我实际上如何使用它?如果我尝试在svn日志编辑缓冲区中调用,我会得到Symbol的函数定义为void:log-edit-show-diff。另外,我的问题是在实际提交之前填充ChangeLog文件,有没有一种方法可以用这种方式使用日志编辑填充呢?事实上,
diff add change log entries other window
应该正是Laurynas所要求的,但它还远远不够完美。我们欢迎对其进行改进(例如,处理删除/添加的文件),但我在尝试它时的经验使我相信,自动完成它需要太多的智能,而且由于实际文本无论如何都必须手工编写,一次完成骨架的好处并不是那么重要。 "Find change log file, and add an entry for today and an item for this file. Optional arg WHOAMI (interactive prefix) non-nil means prompt for user name and email (stored in `add-log-full-name' and `add-log-mailing-address'). Second arg FILE-NAME is file name of the change log. If nil, use the value of `change-log-default-name'. Third arg OTHER-WINDOW non-nil means visit in other window. Fourth arg NEW-ENTRY non-nil means always create a new entry at the front; never append to an existing entry. Option `add-log-keep-changes-together' otherwise affects whether a new entry is created. Option `add-log-always-start-new-record' non-nil means always create a new record, even when the last record was made on the same date and by the same person. The change log file can start with a copyright notice and a copying permission notice. The first blank line indicates the end of these notices. Today's date is calculated according to `add-log-time-zone-rule' if non-nil, otherwise in local time."
(apply 'make-magic-change-log-entry changed-files-list)
diff-add-change-log-entries-other-window is an interactive compiled
Lisp function in `diff-mode.el'.

(diff-add-change-log-entries-other-window)

Iterate through the current diff and create ChangeLog entries.
I.e. like `add-change-log-entry-other-window' but applied to all hunks.