Arc diff在git commit时卡住了。

5

我试图为 Phabricator 确定一个良好的工作流程,并最近对我们的测试项目进行了一些更改以解决一些问题。 我做了几个更改,但忘记将它们放在自己的功能分支中。 所有更改都未提交到 git 中。 我根据所做的更改创建了适用的功能分支并将其提交。 我认为我可以切换到每个分支并执行 arc diff 为它们创建代码审查(我仍然认为可以这样做)。 但是,当我在当前检出的分支上执行 arc diff 时,该命令从未完成。 为了查看发生了什么,我运行了 arc diff --trace。 输出如下。 您可以推断出,它通过提交消息规范(我的情况是通过 Notepad++)并且完全在 [26] git diff 行上死机了(通过“死机”我指它挂起并永远没有完成)。

libphutil loaded from 'S:\web\_arcanist\libphutil\src'.
arcanist loaded from 'S:\web\_arcanist\arcanist\src'.
Working Copy: Reading .arcconfig from "S:\web\_apollo\andreas\bonfire3/.arcconfi
g".
Working Copy: Path "S:\web\_apollo\andreas\bonfire3" is part of `git` working co
py "S:\web\_apollo\andreas\bonfire3".
Working Copy: Project root is at "S:\web\_apollo\andreas\bonfire3".
>>> [0] <conduit> conduit.connect() <bytes = 445>
>>> [1] <http> http://phabricator.mydomain.com/api/conduit.connect
<<< [1] <http> 1,086,426 us
<<< [0] <conduit> 1,089,191 us
>>> [2] <exec> $ git diff --no-ext-diff --no-textconv --raw "HEAD" --
>>> [3] <exec> $ git ls-files --others --exclude-standard
>>> [4] <exec> $ git diff-files --name-only
<<< [3] <exec> 56,380 us
<<< [2] <exec> 84,804 us
<<< [4] <exec> 60,751 us
>>> [5] <event> diff.didCollectChanges <listeners = 0>
<<< [5] <event> 744 us
>>> [6] <exec> $ git rev-parse --verify HEAD^
<<< [6] <exec> 44,265 us
>>> [7] <exec> $ git rev-parse --abbrev-ref --symbolic-full-name '@{upstream}'
<<< [7] <exec> 75,134 us
>>> [8] <exec> $ git rev-parse --git-dir
<<< [8] <exec> 63,179 us
>>> [9] <exec> $ git cat-file -t "origin/master"
<<< [9] <exec> 35,771 us
>>> [10] <exec> $ git merge-base "origin/master" HEAD
<<< [10] <exec> 70,249 us
>>> [11] <exec> $ git log --first-parent --format=medium "91098728f2d669d8c1ce96
c2ba84059b57241fb6"..HEAD
<<< [11] <exec> 59,466 us
>>> [12] <exec> $ git log "HEAD" --not "91098728f2d669d8c1ce96c2ba84059b57241fb6
" --format=%H%x01%T%x01%P%x01%at%x01%an%x01%aE%x01%s%x01%s%n%n%b%x02 --
<<< [12] <exec> 57,813 us
>>> [13] <conduit> differential.query() <bytes = 415>
>>> [14] <http> http://phabricator.mydomain.com/api/differential.query
<<< [14] <http> 136,410 us
<<< [13] <conduit> 139,261 us
You have a saved revision message in '.git\arc\create-message'.
Message begins:

       Installed DBV

You can use this message, or discard it.

    Do you want to use this message? [Y/n] y

>>> [15] <exec> $ git log "HEAD" --not "91098728f2d669d8c1ce96c2ba84059b57241fb6
" --format=%H%x01%T%x01%P%x01%at%x01%an%x01%aE%x01%s%x01%s%n%n%b%x02 --
<<< [15] <exec> 40,860 us
>>> [16] <conduit> differential.parsecommitmessage() <bytes = 356>
>>> [17] <http> http://phabricator.mydomain.com/api/differential.parsecommitmessa
ge
<<< [17] <http> 154,222 us
<<< [16] <conduit> 155,662 us
>>> [18] <event> diff.willBuildMessage <listeners = 0>
<<< [18] <event> 556 us
>>> [19] <exec> $ git branch --no-color
<<< [19] <exec> 60,581 us
>>> [20] <exec> $ "C:\Program Files (x86)\Notepad++\notepad++.exe" -multiInst -n
osession  "C:\Users\andreas\AppData\Local\Temp\2\edit.6y1tzwocr1ookc0c\new-commi
t"
<<< [20] <exec> 2,583,272 us
>>> [21] <conduit> differential.parsecommitmessage() <bytes = 434>
>>> [22] <http> http://phabricator.mydomain.com/api/differential.parsecommitmessa
ge
<<< [22] <http> 156,039 us
<<< [21] <conduit> 158,955 us
>>> [23] <conduit> user.query() <bytes = 254>
>>> [24] <http> http://phabricator.mydomain.com/api/user.query
<<< [24] <http> 101,262 us
<<< [23] <conduit> 103,793 us
>>> [25] <event> diff.didBuildMessage <listeners = 0>
<<< [25] <event> 1,169 us
Linting...
No lint engine configured for this project.
Running unit tests...
No unit test engine is configured for this project.
>>> [26] <exec> $ git diff --no-ext-diff --no-textconv --no-color --src-prefix=a
/ --dst-prefix=b/ -U32767 -M -C "91098728f2d669d8c1ce96c2ba84059b57241fb6" --

我曾尝试将“git diff”命令复制到单独的终端中,并且它可以正常工作。 我以为可能是 PHP 的本地“exec”命令出了问题,因此我创建了一个快速的两行 PHP 文件来运行“git diff”命令……它也可以正常工作。 我让“arc diff”命令在那一行运行了几个小时,但它始终无法完成。 有什么方法可以解决这个问题吗?
更新: 我忘记提到,“arc diff”命令在执行“git commit --amend”时也会挂起。

我遇到了与“git commit --ammend”挂起的类似问题。你解决了这个问题吗?你能否在编辑或自己的答案中提供某种解决方案? - Andresch Serj
1
我想我从来没有找到过解决方案。我刚刚更新了Arcanist,它又开始工作了。不过,如果更新Arc无效,Freenode上的#phabricator irc房间是寻求帮助的好地方。 - SpaDusA
对我来说,似乎是由于提交的文件过大导致的问题。我使用 git add .git push 手动添加了文件,然后它就可以工作了。 - Andresch Serj
2个回答

5

我曾经遇到过同样的问题。经过调试,我发现原因是在执行“git diff”命令时出现了一个警告消息:“LF将被CRLF替换...”。 我使用了“git config core.safecrlf false”的命令来解决这个问题。


0

虽然@summerwind的回答是可行的,但更安全的做法是删除导致LF将被替换为CRLF的文件,然后重新检出它们。

:: del /s/q/f will deiete the .git folder, so you must specify the folder explicity
del /s/q/f <some-folder>
git checkout <some-folder>

或者

# actually it is just good practice
rm -rfv <some-folder>
git checkout <some-folder>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接