首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在git提交上挂起弧形差异

在git提交上挂起弧形差异
EN

Stack Overflow用户
提问于 2014-02-03 04:37:31
回答 2查看 3.9K关注 0票数 5

我正试图为Phabricator找到一个很好的工作流程,最近我对我们的测试项目做了一些修改,以解决一些问题。我做了几次修改,但忘了将它们放在它们自己的特性分支中。所有的修改都没有提交给git。我继续创建了一个特性分支,适用于我所做的更改并提交了它们。我想我可以切换到每个分支,并做一个arc diff来为它们创建代码评审(我仍然认为我可以这样做)。但是,当我在当前签出的分支上执行arc diff时,命令永远不会完成.为了了解发生了什么,我运行了arc diff --trace。输出在下面。正如您可以推测的那样,它通过提交消息规范(在我的例子中是通过Notepad++),然后完全死在[26] git diff行上(而所谓的“死”,我的意思是它挂起,永远不会完成)。

代码语言:javascript
复制
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命令在本地可能出了问题,所以我创建了一个快速的2行PHP文件,以便通过that...worked fine运行git diff命令。我已经让arc diff命令在该行上运行了几个小时,但它还没有完成。对于如何解决这个问题,有什么想法吗?

更新我忘了提到arc diff也挂在git commit --amend上。

EN

回答 2

Stack Overflow用户

发布于 2015-02-27 17:48:38

我也有同样的问题。我进行了调试,发现原因是一条警告信息"LF将被CRLF取代。“在"git diff“执行过程中。我将"git config core.safecrlf false“设置为false,这解决了问题。

票数 5
EN

Stack Overflow用户

发布于 2016-01-27 16:20:40

而@summerwind的答案起作用了。删除导致LF will be replaced by CRLF的文件,然后再检查它们,这样可能更安全。

代码语言:javascript
复制
:: 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>

代码语言:javascript
复制
# actually it is just good practice
rm -rfv <some-folder>
git checkout <some-folder>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21519772

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档