进行git svn dcommit时保留作者历史记录 [英] Keep author history when doing a git svn dcommit

查看:105
本文介绍了进行git svn dcommit时保留作者历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看过旧文章,但我认为它已经过时而现在无法申请.我想知道如何保持作者和时间与所有git commit相同.

I've seen old posts but I think it is too outdated to apply now. I am wondering how to keep the authors and time the same as all the git commits.

目前基本上发生的是,我们承诺在git上创建一个分支.我将其合并到我的svn分支,然后使用dcommit将所有内容推送到SVN存储库.提交在那里,但是它们都是由执行dcommit命令的人提交的,并且所有提交都在同一时间.

Basically what happens currently is, we commit to a branch on git. I merge that to my svn branch and then use dcommit to push all that to SVN repo. The commits are there but they are all committed by the person who did the dcommit command and all the commits are at the same time.

我想要做的是git svn dcommit,它应该使用git commit中的时间,还应该使用git commit中的作者.

What I want is, doing git svn dcommit, it should use the time from the git commit and also use the author from git commit as well.

反正有这样做吗?希望有人能帮忙,谢谢!

Is there anyway to do this? Hope someone can help, thanks!

推荐答案

这不直接支持.
正如在这里评论:

只能通过外部映射来确定适当的提交者,因为用户名约定不一样(git的电子邮件样式,与svn的身份验证绑定).

The proper committer could only be determined through an external mapping, because username conventions aren't the same (email-style for git, tied to authentication for svn).

同一主题建议一些 git-svn 补丁可能会增加作者:

The same thread propose some git-svn patch which might add the author:

editor_cb => sub {
    print "Committed r$_[0]\n";
    $cmt_rev = $_[0];
+   if (defined($_commit_author)) {
+       print "Changed author to $_commit_author\n";
+       $ra->change_rev_prop($cmt_rev, 'svn:author', $_commit_author);
+   }
},

这篇关于进行git svn dcommit时保留作者历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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