2

刚刚在 SubGit 3.2.4 发行说明中看到了这个特性:

支持 svn.gitCommitMessage 和 svn.svnCommitMessage 选项,允许在生成提交消息时指定 SubGit 使用的消息模式。

但我找不到任何关于语法的例子。我想做一次导入,所以我想我运行

subgit configure SVN_REPO repo.git

然后编辑repo.git/subgit/config并添加gitCommitMessage到该svn部分。但是我可以使用哪些变量/占位符?

4

2 回答 2

2

以下是可以使用的占位符:

  • %author = Git 作者(双向可用)
  • %committer = Git 提交者(双向可用)
  • %date = 修订或提交日期(双向可用)
  • %message = 原始消息(双向可用)
  • %note = 存储在 refs/notes/commits 的 Git 提交注释(在 Git => SVN 方向可用)
  • %note(refs/notes/namespace) = 存储在 refs/notes/namespace 的 Git 提交注释(在 Git => SVN 方向可用)
  • %commit = Git 提交哈希(在 Git => SVN 方向可用)
  • %svnUser = Subversion 用户名(双向可用)
  • %revision = Subversion 版本,GRN 在你的符号中(在 SVN => Git 方向可用)
  • %branch = Subversion 分支(双向可用)
  • \n = 换行符(双向可用)

例子:

[svn]
svnCommitMessage = "%message\n\nr%revision %branch"

或者

[svn]
svnCommitMessage = "%message\n%note(refs/notes/test)\n\nr%revision %branch"
于 2017-04-06T05:48:59.860 回答
1

抱歉这么晚才回答。现在该信息在文档中可用,即:

svnCommitMessage 选项说明:

https://subgit.com/config-options.html#svn.svnCommitMessage

可用占位符:

%author = Git author    
%committer = Git committer    
%date = Git commit date    
%message = original message    
%note = Git commit note stored under refs/notes/commits    
%note(refs/notes/namespace) = Git commit note stored under 
refs/notes/namespace
%commit = Git commit hash
%svnUser = Subversion username
%branch = Subversion branch
\n = newline feed

gitCommitMessage 选项说明:

https://subgit.com/config-options.html#svn.gitCommitMessage

支持的占位符:

%author = Git author    
%committer = Git committer    
%date = date of revision    
%message = original message    
%svnUser = Subversion username    
%revision = Subversion revision, GRN in your notation    
%branch = Subversion branch    
\n = newline feed
于 2017-12-04T10:06:10.500 回答