git svn dcommit与TRAILING WHITESPACE在这些文件中发现错误

时间:2012-07-23 05:41:17

标签: git svn

我尝试使用'git svn dcommit'但是遇到了这些错误:

存储库挂钩失败:'pre-commit'挂钩失败并显示错误输出:

*** Transaction blocked
    TRAILING WHITESPACE discovered in these files
        designs/trunk/1167923/cfg/main.cpp
        designs/trunk/1167923/cfg/Registers.cpp

Code does not conform to whitespace standard
 at /usr/lib/git-core/git-svn line 922

我不知道如何修复它。

这是我的配置:

receive.denynonfastforwards=true
alias.st=status
alias.ci=commit
alias.co=checkout
alias.br=branch
alias.log1=log --oneline
alias.fetchavs=fetch --all --progress -v
alias.pushav=push --all --progress -v
alias.dfb=diff -b 
alias.dfw=diff -w
color.ui=auto
color.branch=auto
color.diff=auto
color.interactive=auto
color.status=auto
core.autocrlf=input
core.safecrlf=true
core.whitespace=nowarn
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
svn-remote.svn.url=http://svn
svn-remote.svn.fetch=designs/trunk/1167923:refs/remotes/trunk
svn-remote.svn.branches=designs/branches/1167923/*:refs/remotes/*
svn-remote.svn.tags=designs/tags/1167923/*:refs/remotes/tags/*

1 个答案:

答案 0 :(得分:2)

该错误将来自您的远程(svn)服务器 - 您的git-svn配置并不特别相关。

您需要编辑待处理的提交,以便服务器接受每个提交。

E.g。

  • git rebase -i HEAD~10
  • 识别问题提交
  • 选择e进行编辑
  • 纠正您的空白错误
  • git commit -va --amend
  • git rebase --continue

然后再次尝试dcommit

在您自己的git pre-commit挂钩中放置等效检查符合您的利益 - 这样您在提交时就可以知道在推送到svn时您的更改将被拒绝,因此可以更正。< / p>