我的 svn 存储库中的作者如下:
$ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
输出:
<author>ashfame</author>
<author>clean</author>
<author>clean </author>
<author>rocketweb</author>
但是,当使用 git svn clone 克隆存储库进行导入时,它会在说 Author: clean not Define in/home/ashfame/fun/authors-transform.txt file
注意 clean 后面的双空格,这意味着它是第三个用户“clean”
。
如何格式化我的作者文件以在用户名中包含空格?我当前的内容如下:
ashfame = Ashfame <mail@example.com>
clean = Yogesh Tiwari <yogesh.tiwari@example.com>
clean = Yogesh Tiwari <yogesh.tiwari@example.com>
"clean\ " = Yogesh Tiwari <yogesh.tiwari@example.com>
"clean " = Yogesh Tiwari <yogesh.tiwari@example.com>
rocketweb = rocketweb <rocketweb@rocketweb.com>
(no author) = Yogesh Tiwari <yogesh.tiwari@example.com>
(no author) = no_author
有趣的发现:我尝试在没有任何用户映射的情况下将 svn 存储库导入到 git 中,但我看不到与“clean”用户相关的任何内容,只有“clean”存在,所以我猜测这是svn repo 上有些问题。有什么办法可以解决这个问题吗?
最佳答案
作者姓名中的空格也有类似的问题。
使用author-prog选项解决这个问题,该选项允许您使用bash脚本,该脚本将转换未知的作者。
#!/bin/bash
if [ "$1" = "VisualSVN Server" ];then
echo "VirtualSVNServer <svn.localdomain>";
fi
关于git-svn - 如何在 git svn 的作者文件中包含尾随空格字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9438966/