SubGit: use svn.svnCommitMessage option

霸气de小男生 提交于 2019-12-14 03:58:35

问题


Just seen this feature in the SubGit 3.2.4 release notes:

Support for svn.gitCommitMessage and svn.svnCommitMessage options that allow specifying message patterns used by SubGit while generating commit messages.

But i cannot find any example on the syntax. I want to do a one time import, so i guess i run

subgit configure SVN_REPO repo.git

then edit repo.git/subgit/config and add gitCommitMessage to the svn section. But what are the variables/placeholders i can use?


回答1:


Here are the placeholders that can be used:

  • %author = Git author (available in both directions)
  • %committer = Git committer (available in both directions)
  • %date = date of revision or commit (available in both direction)
  • %message = original message (available in both direction)
  • %note = Git commit note stored at refs/notes/commits (available in Git => SVN direction)
  • %note(refs/notes/namespace) = Git commit note stored at refs/notes/namespace (available in Git => SVN direction)
  • %commit = Git commit hash (available in Git => SVN direction)
  • %svnUser = Subversion username (available in both directions)
  • %revision = Subversion revision, GRN in your notation (available in SVN => Git direction)
  • %branch = Subversion branch (available in both directions)
  • \n = newline feed (available in both directions)

Examples:

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

or

[svn]
svnCommitMessage = "%message\n%note(refs/notes/test)\n\nr%revision %branch"



回答2:


sorry to answer that late. Now the information is available in the documentation, namely:

the svnCommitMessage option description:

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

available placeholders:

%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

the gitCommitMessage option description:

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

supported placeholders:

%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


来源:https://stackoverflow.com/questions/43227319/subgit-use-svn-svncommitmessage-option

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!