git-gui命令在macOS Sierra崩溃

sbo*_*yev 49 git crash macos

更新到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

有没有人有同样的问题和解决方案?

ssa*_*ahu 23

而不是使用默认的MacOS tcl-tk,使用Homebrew中最新的tcl-tk(8.6.6),然后强制链接它,例如:

brew install tcl-tk
brew link tcl-tk --force
Run Code Online (Sandbox Code Playgroud)

  • 我不得不做`brew install homebrew/dupes/tcl-tk` (4认同)

Nai*_*wal 22

尝试: git config --local --unset gui.geometry
由于Tk几何管理器不起作用,由于旧版本或它已损坏而发生此错误.

如果上述命令不起作用,请尝试更新您的xcode: xcode-select --install

  • 这似乎对我有用. (5认同)
  • 我试过这个解决方案对我不起作用https://github.com/git/git-scm.com/issues/853 (2认同)

sbo*_*yev 18

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 版本


Bru*_*uce 5

我的解决方案应该适用于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


Mal*_*chi 5

我从这里收集了一堆答案,因为我通过以下方式使用 GITTCL brew

  1. cd "/usr/local/Cellar/git/2.10.2/share/git-gui/lib/Git Gui.app/Contents/MacOS"
  2. mv Wish Wish.bkp
  3. ln -vs /usr/local/Cellar/tcl-tk/8.6.6/bin/wish8.6 Wish

随着时间的推移,版本号显然可能会有所不同


小智 5

我认为以下目标构成了问题的完整解决方案:

  • “轨道核弹”以简洁线性的方式解决这个问题的确定性

  • 不要以传统 Apple Tcl/Tk 的丑陋字体结束

  • 将您的 git gui 与 Apple 提供的 Tcl/Tk 分离

    • 依靠 Homebrew 安装 Tcl/Tk

您将在下面找到实现此目标的分步说明:

  1. 从 Homebrew 获取重复的 Tcl/Tk

    brew install tcl-tk
    
    Run Code Online (Sandbox Code Playgroud)
  2. 将未损坏的 Tcl/Tk 安装添加到损坏的 Apple 实现之前的路径中

    • 这假设您的 Homebrew 路径优先于您的系统路径
    • 在正常的 Homebrew 安装中应该是这种情况
    • 如果您的其他安装的自制配方有冲突文件,这将失败
    • 例如the_platinum_searcher提供pt,其中冲突
    • 我推荐ripgrep来解决这个问题

      brew link --force tcl-tk
      
      Run Code Online (Sandbox Code Playgroud)
  3. 通过重新安装未损坏的 Homebrew 版本来修复您的 gitk 安装

  4. 将 Homebrew Tcl/Tk 安装中的新 Wish 二进制文件复制到 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"
      
      Run Code Online (Sandbox Code Playgroud)

最后一点可能是明智的做法,~/.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"'
Run Code Online (Sandbox Code Playgroud)

我不完全确定为什么上面使用的 cut 的字段分隔符的引用有效,因此请谨慎使用此别名,因为这很可能取决于确切的 bash 版本。