简体   繁体   中英

Keep author history when doing a git svn dcommit

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.

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.

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!

This is not support directly.
As commented here :

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).

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);
+   }
},

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM