【问题标题】:When I do "git svn rebase" it fetches the svn author names instead of the git author names当我执行“git svn rebase”时,它会获取 svn 作者姓名而不是 git 作者姓名
【发布时间】:2011-10-06 08:57:39
【问题描述】:

我使用git svn clone -A authors.txt ... 克隆了一个svn 存储库。 我的authors.txt 有这样的条目:

svnid = Firstname Lastname <Firstname.Lastname@example.com>

效果很好,在git log 中,作者看起来像:

Author: Firstname Lastname <firstname.lastname@example.com>

现在当我git svn rebase -A authors.txt 时,新条目的作者看起来像这样:

Author: svnid <svnid@12345678-1234-1234-1234-123456789abc>

我使用了来自“Retroactively Correct Authors with Git SVN?”的已接受答案 修复它,但在下一个git svn rebase -A authors.txt 之后,作者再次被摧毁。

我可以做些什么来保留正确的作者姓名?

编辑:我使用的是 git 版本 1.7.6.msysgit.0 显然是在 Windows 上。

【问题讨论】:

  • 奇怪。我在存储库中设置了svn.authorsfile,不仅它总是使用它(我从不将 -A 传递给 rebase),而且如果 svn 用户名不存在,它甚至会失败,我必须在它继续之前填写它。
  • 根据手册页,它应该是这样工作的。我也尝试设置git config svn.authorsfile authors.txt,但没有任何改变。
  • 也许是时候在项目邮件列表中询问了。

标签: git svn git-svn


【解决方案1】:

svn.authorsfile 有点艺术许可(又名错误)。如果您在$EDITOR 中打开 .git/config 文件,您将看到如下内容:

[svn-remote "svn"]
url = https://crosswire.org/svn/sword
fetch = trunk:refs/remotes/trunk
branches = branches/*:refs/remotes/*
tags = tags/*:refs/remotes/tags/*

添加行

authorsfile = .git/svn/authors.txt

作为该部分的最后一行(当然,将您的 authors.txt 文件放到 .git/svn/ 目录中)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-04-13
    • 1970-01-01
    • 2021-05-18
    • 2017-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多