[英]git-gui command crashes on macOS Sierra
更新到macOS Sierra后, git-gui
命令崩潰並出現錯誤:
Wish[23862:202062] *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [0 nan]' *** First throw call stack: ( 0 CoreFoundation 0x00007fff8cd9252b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x00007fffa146acad objc_exception_throw + 48 2 CoreFoundation 0x00007fff8ce10a0d +[NSException raise:format:] + 205 3 QuartzCore 0x00007fff92938980 _ZN2CA5Layer12set_positionERKNS_4Vec2IdEEb + 152 4 QuartzCore 0x00007fff92938af5 -[CALayer setPosition:] + 44 5 QuartzCore 0x00007fff9293914b -[CALayer setFrame:] + 644 6 CoreUI 0x00007fff986e2112 _ZN20CUICoreThemeRenderer26MakeOrUpdateScrollBarLayerEPK13CUIDescriptoraPP7CALayer + 1284 7 CoreUI 0x00007fff986de317 _ZN20CUICoreThemeRenderer19CreateOrUpdateLayerEPK13CUIDescriptorPP7CALayer + 1755 8 CoreUI 0x00007fff986604d1 _ZN11CUIRenderer19CreateOrUpdateLayerEPK14__CFDictionaryPP7CALayer + 175 9 CoreUI 0x00007fff98663185 CUICreateOrUpdateLayer + 221 10 AppKit 0x00007fff8b3c7623 -[NSCompositeAppearance _callCoreUIWithBlock:options:] + 226 11 AppKit 0x00007fff8aa74a9d -[NSAppearance _createOrUpdateLayer:options:] + 76 12 AppKit 0x00007fff8aced143 -[NSScrollerImp _animateToRolloverState] + 274 13 AppKit 0x00007fff8acacb79 __49-[NSScrollerImp _installDelayedRolloverAnimation]_block_invoke + 673 14 AppKit 0x00007fff8ab73331 -[NSScrollerImp _doWork:] + 15 15 Foundation 0x00007fff8e770c88 __NSFireDelayedPerform + 417 16 CoreFoundation 0x00007fff8cd11e14 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20 17 CoreFoundation 0x00007fff8cd11a9f __CFRunLoopDoTimer + 1071 18 CoreFoundation 0x00007fff8cd115fa __CFRunLoopDoTimers + 298 19 CoreFoundation 0x00007fff8cd09021 __CFRunLoopRun + 2065 20 CoreFoundation 0x00007fff8cd085b4 CFRunLoopRunSpecific + 420 21 Tcl 0x0000000101834b43 Tcl_WaitForEvent + 314 22 Tcl 0x00000001018045cd Tcl_DoOneEvent + 274 23 Tk 0x0000000101672f4f Tk_MainLoop + 33 24 Tk 0x000000010167ea5b Tk_MainEx + 1566 25 Wish 0x0000000101658542 Wish + 9538 26 libdyld.dylib 0x00007fffa1d48255 start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException error: git-gui died of signal 6
有沒有人有同樣的問題和解決方案?
不使用默認的MacOS tcl-tk
,而是使用Homebrew中最新的tcl-tk(8.6.6),然后強制鏈接它,例如:
brew install tcl-tk
brew link tcl-tk --force
嘗試: git config --local --unset gui.geometry
由於舊版本或損壞,Tk Geometry管理器不起作用,會發生此錯誤。
如果上述命令不起作用,請嘗試更新您的xcode: xcode-select --install
MacOS Sierra上的Tk 8.5存在問題。 你可以用Tk Wish 8.4取代Tk Wish 8.5
cp /System/Library/Frameworks/Tk.framework/Versions/8.4/Resources/Wish.app/Contents/MacOS/Wish /usr/local/Cellar/git/2.10.1/share/git-gui/lib/Git\ Gui.app/Contents/MacOS/
來源: https : //github.com/git/git-scm.com/issues/853
UPD:注意用你當前的版本替換cp
路徑中的git版本
我的解決方案應該適用於https://git-scm.com/的git下載
brew install homebrew/dupes/tcl-tk
cd到/usr/local/git/share/git-gui/lib/Git Gui.app/Contents/MacOS
並備份原始的願望
cp /usr/local/Cellar/tcl-tk/8.6.6/bin/wish8.6 /usr/local/git/share/git-gui/lib/Git Gui.app/Contents/MacOS/Wish
我從這里聚集了一堆答案,因為我通過brew
使用GIT 和 TCL:
cd "/usr/local/Cellar/git/2.10.2/share/git-gui/lib/Git Gui.app/Contents/MacOS"
mv Wish Wish.bkp
ln -vs /usr/local/Cellar/tcl-tk/8.6.6/bin/wish8.6 Wish
隨着時間的推移,版本號可能會有所不同
我認為以下目標構成了問題的完整解決方案:
“來自軌道的核武器”確定了以一種整潔和線性的方式解決這個問題
最終不要使用傳統Apple Tcl / Tk中的丑陋字體
將你的git gui與Apple發運的Tcl / Tk分開
您將在下面找到實現此目標的步驟:
從Homebrew獲取重復的Tcl / Tk
brew install tcl-tk
在破壞的Apple實現之前,將未破壞的Tcl / Tk安裝添加到路徑中
the_platinum_searcher
提供了沖突的pt
我推薦使用ripgrep來解決這個問題
brew link --force tcl-tk
通過重新安裝不間斷的Homebrew版本來修復您的gitk安裝
這可能沒有必要,但參考。 上面提到的第一個目標
brew reinstall git
將Homebrew Tcl / Tk安裝中的新願望二進制文件復制到Git Gui.app包中來自Apple的已損壞捆綁的二進制文件
這盲目地依賴於homebrew info <package>
的輸出而不改變
cp "$(which wish)" "$(brew info git | grep Cellar | cut -d' ' -f1)/share/git-gui/lib/Git Gui.app/Contents/MacOS/Wish"
最后一點可能是明智的做法到你的~/.bashrc
和/或等效的別名,因為它必須在每次從Homebrew獲得新的git版本時重復。
alias fix-gitgui='cp "$(which wish)" "$(brew info git | grep Cellar | cut -d" " -f1)/share/git-gui/lib/Git Gui.app/Contents/MacOS/Wish"'
我不完全確定為什么上面使用的字段分隔符字符的引用有效,所以請謹慎使用此別名,因為這很可能取決於精確的bash版本。
它適用於我:下載並安裝最新版本的TCL(我使用的是8.6.4) http://www.activestate.com/activetcl/downloads
我還下載並安裝了最新版本(2.10.1)的git https://git-scm.com/
調整大小后,檢查gitk窗口是否沒有崩潰。
@ sbondaryev的回答(39966704)對我不起作用,我還沒試過@ ssahu(40119030)。 然而,我在這里描述的技巧對我來說崩潰的頻率要低得多(10%的時間左右)。 它讓我不會因為太多事情而陷入困境 - 希望這個問題很快得到解決。
vi .git/config
GUI geography
以創建有效的窗口大小。 我仍然保持小,雖然我懷疑會有一個大小,總是會發生崩潰 我的Sierra(從10.11.6升級)的Tcl / Tk Current指向8.5,我在升級后觀察到同樣的錯誤,我們的Python程序使用Tkinter。 我不是在使用Wish。 我沒有得到鏈接到Tcl / Tk 8.4的Python 2.7 32位安裝的幫助,因為那個沒有“tile”。 所以我釀造了我的Python,將它與Tcl / Tk 8.6連接起來:
這是釀造使用預編譯的瓶子而不是從源代碼構建,除非另有特別指示,因此不會導致問題:
xcode-select --install
然后安裝Tcl / Tk:
brew install homebrew/dupes/tcl-tk
如果您最初沒有使用--with-tcl-tk安裝Python,那么:
brew uninstall python
最后:
brew install python --with-tcl-tk
在此之后,我有鏈接到Tcl / Tk 8.6的Python,看起來我擺脫了錯誤。
這已經在macOS Sierra(10.12.2及更高版本)的最新補丁中得到解決,無需采取進一步行動。
經過很多努力,這個解決方案解決了我的問題:
$ brew upgrade tcl-tk
如果它是最新的,但這不起作用,請嘗試:
$ brew uninstall tcl-tk
$ brew install tcl-tk
我已嘗試過網絡中的每個解決方案,但這只能解決問題。 干杯!
在High Sierra(10.13)我和git gui有同樣的問題。
我已經通過將git從2.7.0更新到2.14.2來解決了這個問題
brew upgrade git
一個對我有用的修復:斷開第二個監視器,打開git gui
- >工作,關閉它,重新連接第二個監視器並運行git gui
- >再次工作:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.