Commit Graph

26 Commits

Author SHA1 Message Date
Ronald Wampler
d60c47ef42 Commit button title summarizes the number of files to be committed 2014-08-28 13:40:24 +02:00
Ronald Wampler
0361afe340 Rework the commit window as a sheet (document modal)
Previously, the commit window was changed from a "always on top" window to a more typical window that could be minimized or sent to the background. While this made viewing the diffs more convenient, we could easily loose track of it or at worst end up with multiple dangling commit windows. By making it document modal, this prevents dangling windows. Furthermore, since the commit window is now attached to the main project window and the file browser already has the SCM status, we hide the file list by default and dropped the action button. Users can choose to show the file list via a checkbox and the action button's menu is still available via the file list's context menu.
2014-08-28 13:40:24 +02:00
Ronald Wampler
4b31a3fde0 Send diffs to a separate window 2014-08-28 10:16:25 +02:00
Ronald Wampler
3934f1be46 Use dictionary literals 2014-08-08 14:53:43 +02:00
Ronald Wampler
dab45a5c08 Remove no longer used option for the Commit Window
Originally, the "--ask" option was used in the previous commit window to change the NSTextField above the text view; however, no SCM bundles (in textmate's repos) currently uses it.
2014-08-08 14:53:43 +02:00
Ronald Wampler
fc5dcf4020 Prefer NULL to nop: in most cases
This change was prompted by the appearance of the `tabSizePopUp` button in the status bar. After dismissing the menu, the title would be disabled.

To ensure we do not have similar issues elsewhere, let's prefer the use of `NULL` to `nop:` when assigning the action for menu items unless we are sure that the menu item should always be disabled (e.g., the item is used as a label).
2014-04-30 12:09:47 +07:00
Allan Odgaard
c272afaff2 Cleanup/harmonize whitespace
Leading indent should consist only of tabs, beyond that, only spaces should be used.
2014-04-25 16:55:31 +07:00
Allan Odgaard
4474419405 Use API available on 10.7 for the commit window’s NSTableView
We’re using an NSViewController to load the nib so that we do not need to manually release the top level objects.
2014-04-16 22:55:16 +07:00
Allan Odgaard
39b94e6ac3 Harmonize whitespace and add trailing newline 2014-04-14 14:26:52 +07:00
Allan Odgaard
3e8fd7b72a Use bundle item name in Commit Window’s title
This means using Git → Amend Last Commit… will show “Amend Last Commit” in the window title.
2014-04-13 13:09:11 +07:00
Allan Odgaard
3f55166f15 Assign ⌘. to the commit window’s cancel button
While ⌘. already triggers any cancelOperation:/cancel: method found in the responder chain, making it explicit gives visual feedback when user press the key, and ensures that another control doesn’t get the key (by responding to cancelOperation:/cancel:).
2014-04-12 14:13:50 +07:00
Allan Odgaard
eaa2faa18a Change to project folder when running commands from commit window 2014-04-11 13:12:48 +07:00
Ronald Wampler
196f37729f fixup! Allow user to clear previous commit messages 2014-04-11 13:12:48 +07:00
Ronald Wampler
b942455d8f Implement "--log" option for commit window
This fixes a regression. The previous commit window allowed a "--log" option to be specified that would pre-populate the text view with the given argument.
2014-04-11 13:12:48 +07:00
Allan Odgaard
65e9b45d8a Treat commit window action command names as format strings
Presently the ‘TM_DISPLAYNAME’ is conditionally available, allowing the name to contain the file name which it will work with.

Also fix a potential “out of range” exception. The validateMenuItem: could be called for a cached menu item (e.g. when the system resolves key equivalents) where we had no selection (nor did click any item), so we would access the row at index -1.
2014-04-11 10:57:11 +07:00
Allan Odgaard
445468cbf5 Make list of items to be committed contain exactly 10 rows 2014-04-11 10:57:10 +07:00
Allan Odgaard
62f2debfc8 Store commit window frame in user defaults 2014-04-10 17:46:31 +07:00
Allan Odgaard
74572309f1 Allow user to clear previous commit messages 2014-04-10 11:13:28 +07:00
Allan Odgaard
751d2c2924 Let commit window’s title match that of the main window
In practice we could source ‘.tm_properties’ with ‘TM_DISPLAYNAME’ set to “Commit” (and ‘TM_FILENAME/PATH’ unset) to use user’s ‘windowTitle’, though it could result in wrong titles for users who have configured window titles to include parent path components without proper fallback to ‘TM_DISPLAYNAME’.
2014-04-10 11:13:13 +07:00
Allan Odgaard
de1c6aa5a9 Add commit message to history even if user cancels the dialog
The rationale is that while the user is writing a commit message they might be reminded of something that should be fixed before committing, so they’ll cancel but wish to come back to the partially written message later.
2014-04-05 14:13:39 +07:00
Ronald Wampler
16330d039e Show last commit message in the Previous Commit Messages menu
This was previously set to a pop-up menu, hence the need for a placeholder item to set the menu title. However, for pull-down menus, the first item is used as the title and remains fixed.

This difference in behavior caused the last used commit message (first item) not to be listed in the menu.
2014-04-03 23:43:10 -04:00
Ronald Wampler
32ef9c8d67 Set display name when sending diff to TextMate
We set the name as:

	'---/+++ file'

I wanted the display name to suggest a diff without calling it something directly as "file (diff)", so I thought '---/+++' would be a nice and condense way of indicating that.
2014-04-03 23:20:03 -04:00
Ronald Wampler
0ce77e8de7 We use camelCase for local variables 2014-04-03 23:20:02 -04:00
Allan Odgaard
9018e8b1aa Rework command execution (diff, revert, etc.)
I wanted to get rid of calling /usr/bin/which but ended up also modifying the methods that used the absolutePathForPath: method.
2014-04-03 15:51:47 +07:00
Ronald Wampler
201f247b2f New (native) commit window
This is based on the previous commit window code base. It replaces the NSTextView with a OakTextView for entering the commit messages. This allows us to take advantage of some of the git grammar features, e.g., fixup!.

If other SCM bundles are updated in the future to include any specific grammars, these can be used in the commit window by setting the bundle grammar to "text.SCM-commit", where SCM could be hg or svn for example.

Changes to note:

	*  The Modify row button for the "--action-cmd" commands are now implemented in the action menu and the table context menu.

	*  The shortcut for committing is ⌘↩ (but fn-return seems to (still) work).
2014-04-03 15:51:05 +07:00
Allan Odgaard
645c837262 Skeleton commit window server
This allows the commit command line tool to open a window as “native”.

We use distributed objects for talking to TextMate and getting a response. For the response, we release the connection in the next iteration of the event loop and then gracefully exit the program. Though it’s not clear if this is enough time for distributed objects to reply the client (if not, an exception is thrown in the client about “connection disappeared while waiting for a reply”).
2014-04-03 15:49:58 +07:00