git svn fetch为分支多次检索相同的Subversion修订版

raz*_*zeh 33 git git-svn

我看到git svn fetch在我的Subversion存储库中找到分支时重复检索相同的Subversion修订版.我们使用标准的Subversion存储库布局,顶级/ trunk,/ tags和/ branches目录(git存储库是使用'git svn init -s'创建的).但是,有问题的分支通常是从主干内部的子目录而不是主干创建的副本.

git svn fetch输出通常看起来像这样:

r2537 = d5b22e956157af036d4112e42e8fb927e45758c8 (trunk)
        M       Enterprise/VC/libgc/SymbolVenue.cpp
r2538 = cfed4ca0491da0b732f32bfff72ba678450a0915 (trunk)
Found possible branch point: http://repo/prod_repos/trunk/Enterprise/VC => http://repo/prod_repos/branches/file_conversion, 2523
W: Refspec glob conflict (ref: refs/remotes/scripter@832):
expected path: branches/scripter@832
    real path: trunk/Enterprise/Python
Continuing ahead with trunk/Enterprise/Python
W: Refspec glob conflict (ref: refs/remotes/trunk):
expected path: branches/trunk
    real path: trunk
Continuing ahead with trunk
Initializing parent: file_conversion@2523
        A       gc/QuoteService.cpp
        A       gc/TestSuite.h
        A       gc/quote_svc.pro
        A       gc/QuoteService.h
.....

r1 = d349ed8cb2d76596fe2b83224986275be4600fad (QuoteSvcFix442@2698)
        D       gc/FixMessageLogger.h
.....
r5 =
r19 =
r20 = 
.....

我们回到修订版1. git svn fetch然后继续获取修订版,直到它到达创建分支的修订版.

我究竟做错了什么?反正我有没有告诉git svn fetch不能检索它已经拉过的修订版?

pat*_*ikf 66

我注意到这个问题,因为我得到了同样的错误信息:

W: Refspec glob conflict (ref: refs/remotes/trunk):
expected path: branches/trunk
    real path: trunk
Run Code Online (Sandbox Code Playgroud)

原来,.git/config有重复的行似乎混淆了git-svn,如下所示:

[svn-remote "svn"]
...
    branches = project/branches/*:refs/remotes/*
    tags = project/tags/*:refs/remotes/tags/*
    branches = project/branches/*:refs/remotes/*
    tags = project/tags/*:refs/remotes/tags/*
Run Code Online (Sandbox Code Playgroud)

删除那些重复项为我解决了奇怪的git-svn行为,也许对你来说也是如此.我不确定是什么原因导致git-svn首先复制这些信息.我杀了并继续了最初的克隆,这可能是相关的?

  • 我也有这个问题.我也杀了初始克隆并重新启动.看起来可能是原因...... (4认同)
  • 在我的情况下,问题至少不是svn-remote中的重复条目.这个问题对于git-svn架构来说有点基础.简而言之,git svn不会跟踪目录或文件重命名,这意味着它必须重新获取历史记录.git svn作者Eric Wong有更好的描述[这里](http://osdir.com/ml/git/2009-07/msg01665.html) (3认同)
  • 同样的问题在这里 每次运行`git svn clone -s https:// project/repo project`时,它都会复制.git/config中的数据. (2认同)
  • 我的问题是,当由于HTTP打嗝而失败时,我重新运行了`git svn clone`操作. (2认同)

小智 10

删除重复项仍然给我带来了问题.每次重新运行克隆命令时,例如git svn clone svn://.../svnroot --no-metadata -A authors-transform.txt --stdlayout.它为.git/config增加了两行.我不得不删除包含branches = branches /的所有行:refs/remotes /tags = tags/:refs/remotes/tags /

保留配置如下所示:

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[svn-remote "svn"]
        noMetadata = 1
        url = svn://.../svnroot
        fetch = trunk:refs/remotes/trunk
[svn]
        authorsfile = /home/users/denn/authors-transform.txt
~
Run Code Online (Sandbox Code Playgroud)