Commit button does nothing in SourceTree
Asked by Hiten Parmar:

Hi,

I have a problem where pushing the "Commit" button does not bring up the new commit dialog. This happens in both 1.3.0 (App Store) and 1.3.1.1 (Downloaded). I've also reinstalled and redownloaded the application.

Mac OS X 10.7.2.

Thanks.


Answers:
author: tvoglund
body: Any solutions, I am seeing same issue.


author: Patrick Turley
body: I'm having this problem with version 1.9.1 (for the Mac).

I have never defined any custom actions, and I have none defined now.

What is your advice?


author: Hiten Parmar
body: Ok. Trashed 1.3.0 and downloaded and installed 1.3.1.1.

Open a git repo, hit commit...

```
2/9/12 4:22:55.628 PM SourceTree: *** Assertion failure in -[NSMenuItem initWithTitle:action:keyEquivalent:], /SourceCache/AppKit/AppKit-1138.23/Menus.subproj/NSMenuItem.m:3182/9/12 4:22:55.628 PM SourceTree: Invalid parameter not satisfying: charCode != nil2/9/12 4:22:55.629 PM SourceTree: (	0   CoreFoundation                      0x00007fff81aaa286 __exceptionPreprocess + 198	1   libobjc.A.dylib                     0x00007fff865fad5e objc_exception_throw + 43	2   CoreFoundation                      0x00007fff81aaa0ba +[NSException raise:format:arguments:] + 106	3   Foundation                          0x00007fff8420d7d3 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 169	4   AppKit                              0x00007fff8309fe85 -[NSMenuItem initWithTitle:action:keyEquivalent:] + 257	5   SourceTree                          0x000000010004e8f3 SourceTree + 321779	6   SourceTree                          0x000000010004f118 SourceTree + 323864	7   AppKit                              0x00007fff831b7a8a -[NSViewController view] + 41	8   SourceTree                          0x0000000100076975 SourceTree + 485749	9   AppKit                              0x00007fff832882c3 -[NSWindowController _windowDidLoad] + 566	10  AppKit                              0x00007fff8327f9a3 -[NSWindowController window] + 109	11  SourceTree                          0x0000000100070a95 SourceTree + 461461	12  CoreFoundation                      0x00007fff81a99a1d -[NSObject performSelector:withObject:] + 61	13  AppKit                              0x00007fff836d6e18 -[NSToolbarButton sendAction:to:] + 82	14  AppKit                              0x00007fff836d6e66 -[NSToolbarButton sendAction] + 68	15  AppKit                              0x00007fff8322c81a -[NSToolbarItemViewer mouseDown:] + 4995	16  AppKit                              0x00007fff831570e0 -[NSWindow sendEvent:] + 6306	17  AppKit                              0x00007fff830ef68f -[NSApplication sendEvent:] + 5593	18  AppKit                              0x00007fff83085682 -[NSApplication run] + 555	19  AppKit                              0x00007fff8330480c NSApplicationMain + 867	20  SourceTree                          0x0000000100002244 SourceTree + 8772)
```

Seems to be the same thing. I have no idea what I did. I did make a custom action to open a commit on GitHub and bound it to Shift-Apple-H, so definitely could be a data problem.

comments: author: stevestreeting
body: Yeah, definitely a problem with the shortcut key associated with a custom action. I did fix a problem with some blank keyboard shortcuts in 1.3.1 so I thought that would fix it. Can you get into Preferences \> Custom Actions and delete that item to see if that fixes it? You should be able to re-create it, I wonder if it's something to do with version switching.

If you can't delete it in the interface, you can reset the custom actions by deleting the file \~/Library/Application Support/SourceTree/actions.plist.


author: Hiten Parmar
body: Removing just the assigned shortcut key didn't work, but deleting all custom actions (I had another one to open the file in Sublime Text) did fix the problem immediately. A restart of SourceTree was not needed.

However, if I add a new custom action, the Commit dialog does not appear. If I give the Custom Action a shortcut key, it does work. Restarting the app does not change this behavior.


author: stevestreeting
body: I'm putting some extra checks in there anyway to protect against it, the bugfix in 1.3.1 should have prevented the problem from ever occurring (and it seems to here), but I'll put an extra belt \& braces check in just before this call in case a nil keycode somehow sneaks in from somewhere.


author: stevestreeting
body: Hmm, and this is definitely with 1.3.1\[.1\]? This is precisely the bug that was fixed with custom actions in 1.3.1+, and I can't re-create it here.


author: Patrick Turley
body: I'm having this problem with version 1.9.1 (for the Mac).

I have never defined any custom actions, and I have none defined now.

What is your advice?


author: Hiten Parmar
body: Here's some info from Console.app (SourceTree 1.3.0 from App Store).

Open SourceTree...

```
2/9/12 9:33:58.744 AM SourceTree: open on /Users/hiten/Library/Application Support/SourceTree/MASReceipt/xCwDPInN: File exists2/9/12 9:33:58.786 AM SourceTree: Could not connect the action registration: to target of class SourceTreeAppDelegate2/9/12 9:33:58.786 AM SourceTree: Could not connect the action installCommandLineTools: to target of class SourceTreeAppDelegate2/9/12 9:33:59.032 AM SourceTree: *** Assertion failure in -[NSMenuItem initWithTitle:action:keyEquivalent:], /SourceCache/AppKit/AppKit-1138.23/Menus.subproj/NSMenuItem.m:3182/9/12 9:33:59.033 AM SourceTree: Invalid parameter not satisfying: charCode != nil
```

Open git repo from Bookmarks with unstaged changes...

Click "Commit"...

```
2/9/12 9:35:40.191 AM SourceTree: *** Assertion failure in -[NSMenuItem initWithTitle:action:keyEquivalent:], /SourceCache/AppKit/AppKit-1138.23/Menus.subproj/NSMenuItem.m:3182/9/12 9:35:40.191 AM SourceTree: Invalid parameter not satisfying: charCode != nil2/9/12 9:35:40.193 AM SourceTree: (	0   CoreFoundation                      0x00007fff81aaa286 __exceptionPreprocess + 198	1   libobjc.A.dylib                     0x00007fff865fad5e objc_exception_throw + 43	2   CoreFoundation                      0x00007fff81aaa0ba +[NSException raise:format:arguments:] + 106	3   Foundation                          0x00007fff8420d7d3 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 169	4   AppKit                              0x00007fff8309fe85 -[NSMenuItem initWithTitle:action:keyEquivalent:] + 257	5   SourceTree                          0x0000000100049ac3 SourceTree + 301763	6   SourceTree                          0x000000010004a2e8 SourceTree + 303848	7   AppKit                              0x00007fff831b7a8a -[NSViewController view] + 41	8   SourceTree                          0x000000010007016e SourceTree + 459118	9   AppKit                              0x00007fff832882c3 -[NSWindowController _windowDidLoad] + 566	10  AppKit                              0x00007fff8327f9a3 -[NSWindowController window] + 109	11  SourceTree                          0x000000010006a2b5 SourceTree + 434869	12  CoreFoundation                      0x00007fff81a99a1d -[NSObject performSelector:withObject:] + 61	13  AppKit                              0x00007fff836d6e18 -[NSToolbarButton sendAction:to:] + 82	14  AppKit                              0x00007fff836d6e66 -[NSToolbarButton sendAction] + 68	15  AppKit                              0x00007fff8322c81a -[NSToolbarItemViewer mouseDown:] + 4995	16  AppKit                              0x00007fff831570e0 -[NSWindow sendEvent:] + 6306	17  AppKit                              0x00007fff830ef68f -[NSApplication sendEvent:] + 5593	18  AppKit                              0x00007fff83085682 -[NSApplication run] + 555	19  AppKit                              0x00007fff8330480c NSApplicationMain + 867	20  SourceTree                          0x0000000100001684 SourceTree + 5764)
```

No dialog displays. Other dialogs seem to work (Pull, Fetch, Branch)

comments: author: stevestreeting
body: Have you used the direct version from the website at some point then gone to the App Store version? Unfortunately Apple haven't approved the 1.3.1 update yet and there were some fixes to Custom Actions keyboard shortcuts, which could cause data problems if you go backwards in version to 1.3.0 afterwards. The message certainly indicates a problem with that.

You should be able to resolve this by using the direct download version from the website.


author: stevestreeting
body: Wow, that's an odd one. Is there any information in Console.app (searching for SourceTree should filter it down)?

Resetting your preferences by renaming / deleting \~/Library/Preferences/com.torusknot.SourceTree.plist and \~/Library/Preferences/com.torusknot.SourceTreeNotMAS.plist might resolve it but I'd quite like to know the underlying cause.