2

Xcode git commit has started crashing.

I recently upgraded my code in preparation for IOS9 XCode7 to work with swift2.0 and did some file reorg using 'git mv' and had it all working, i.e. it committed okay, they while using Xcode7 beta6 it started crashing when I tried to do commits. I have been doing commits from a terminal for a while and when Xcode7 was released I tried again but it still crashes without any explanation. Before I started the conversion I stopped using the source directory and made a separate copy to use during the conversion. In order to get to a working state I have reverted to XCode 6.4 and used the old code but it also crashes. I have even created a new project to no avail.

So, is there something known solution to this problem? And is git "too clever by half' and finds other repositories and causes problems there?

Sojourner9
  • 158
  • 11
  • May I know whether you are running Git from the bash tool, or whether you are using some sort of Git plugin for XCode (I have never used XCode). – Tim Biegeleisen Sep 18 '15 at 05:29
  • Xcode has a bar on top that does commits, branches, history, but not all the stuff that git can do like git mv. I don't know how Xcode implements git. When I run git outside of Xcode it is from a command line. Also, lots of people complain about using git through xcode and so they don't use it that way. I may be among that crowd soon. I like the graphic way it shows modified files and the diffs. Also note to others, I can use the version editor ok so it knows how to drill in to git but crashes on the commit. – Sojourner9 Sep 18 '15 at 06:40
  • I can tell you that I have seen bugs in eGit, which is the Git plugin for Eclipse. So I personally do not trust the plugins when I want Git to be absolutely stable during development. – Tim Biegeleisen Sep 18 '15 at 07:52

2 Answers2

1

Rebooting the computer fixed this problem. Seems to fix several questions I have been looking at on stackoverflow so I thought I would try it.

Sojourner9
  • 158
  • 11
-1

This question is a bit old but apparently the problem can still happen in Xcode 8 as I started seeing this problem too; or at least what seems like this problem.

I solved this using the instructions that I found in the article: The Curious Case Of Xcode’s Commit Message.

Basically the article explains how the commit message gets persisted in macOS's pasteboard system and needs to be cleared. That would explain why rebooting fixed this according to @Sojourner9. No need to go to that length though.

Running the following from a terminal sufficed for fixing this problem for me:

printf "from AppKit import NSPasteboard\nNSPasteboard.pasteboardWithName_(\"IDESourceControlCommitMessagePasteboard\").releaseGlobally()" | /usr/bin/python

Note that this is slightly different than what the article says. I replaced the use of echo with printf. printf did the right thing with the \n character in the string. echo meanwhile, had failed for me.

Hope this helps.

Louis Langholtz
  • 2,913
  • 3
  • 17
  • 40