Commit Graph

47 Commits

Author SHA1 Message Date
Allan Odgaard
417193e089 Update link dependencies for all targets
Some targets were including headers from frameworks not specified in their link dependencies. For a clean build this could cause an issue because the header was not available at the time of building the target.

The updated link dependencies are also based on what a target’s tests require. Ideally tests would have separate link dependencies, but as we don’t want to maintain this manually, this will have to wait until the build system automatically handles link dependencies.

Currently the commit command uses constants from the CommitWindow framework but should actually not be linked with it. However, the optimizer will strip dead code, so it should not result in much if any difference in the resulting binary and does solve a build dependency issue.
2016-05-07 13:00:55 +02:00
Ronald Wampler
87df09684f CommitWindow: Force update of constraints after animation is completed
This is necessary to prevent resizing of the document view when removing and then immediately adding a new constraint to the document view.
2016-02-04 23:51:50 +07:00
Allan Odgaard
bdcba4d66e Change --amend option to --commit-button-title Amend
This allows us to set arbitrary titles, should we need it in the future.

It also changes the code slightly so that there is only one method to create the full button title.
2015-10-29 09:30:23 +07:00
Allan Odgaard
e1bbc9f358 Change --rebase-in-progress option to --show-continue-button
Also change the property accordingly.
2015-10-29 09:03:16 +07:00
Jacob Carlborg
d988cf18c2 Support "Amend" as button title in the commit window
When the --amend flag is passed to the "commit" command, the commit
window will used "Amend" instead of "Commit" as the title for the
commit button.
2015-10-29 08:54:06 +07:00
Jacob Carlborg
cc7e2e8322 Add support for commit and continue in the commit window
The use case for this feature is when an interactive rebase is in
progress and be able to, in one command, amend the current commit
and continue with rebase.

By default, if the --rebase-in-progress flag is passed when the
"commit" command is invoked the commit button will be in a
"commit and continue" state. This is indicated by the title of the
commit button now being "Commit & Continue". If the option (⌥) key
is being hold down the state will revert back to the standard "commit"
state and the title will change to "Continue".

If the butten was clicked when it was in the "commit and continue"
state the "commit" command will print "TM_SCM_COMMIT_CONTINUE=1"
(without the quotes) to stdout as the last line. If the button was
clicked when it was in the standard "commit" state the output may
contain "TM_SCM_COMMIT_CONTINUE=0", or the "TM_SCM_COMMIT_CONTINUE"
string will be absent.
2015-10-29 08:54:06 +07:00
Allan Odgaard
37df09bf7b Use to_s instead of sending UTF8String 2014-11-29 10:01:23 +07:00
Allan Odgaard
b581e20ad9 Add wrapper for adding views with auto layout enabled 2014-11-05 00:09:37 +01:00
Allan Odgaard
7ead6d418c Make the OakCreateLabel function more versatile 2014-11-04 22:22:57 +01:00
Allan Odgaard
dc01d80c55 Use local variable instead of property
The property is “assign” so in theory the text field could be released before we add it to its superview. Using the local variable ensures that won’t happen.
2014-11-04 22:10:30 +01:00
Ronald Wampler
b9b9a7fa54 Bring the action button back for the commit window
The new layout allows us to place the action button back in its original place when the table is revealed.
2014-10-28 23:03:40 -04:00
Ronald Wampler
b9b6ecf025 Disable toggle button in the commit window when animating 2014-10-28 23:03:40 -04:00
Ronald Wampler
c4f7b38882 Rename populateTableView to setupArrayController
With the previous refactoring the new name is more appropriate.
2014-10-28 23:00:47 -04:00
Ronald Wampler
12f964c3fa Commit Window: Refactor
The view layout is rearranged in order to animate showing the table, which is now shown below the toggle button with the Cancel and Commit buttons sliding down. Additionally, when not showing the table we remove all relevant views from memory.
2014-10-28 22:59:19 -04:00
Allan Odgaard
844f24eb63 Remove the commit window framework’s Info.plist
This is only required when we have resources (and need to build the target as a framework bundle).
2014-10-19 21:59:37 +02:00
Ronald Wampler
986b9f54af Switch to programmatic CWTableCellView 2014-10-19 21:59:37 +02:00
Ronald Wampler
8902ccf4fe Don't use deprecated mate API 2014-10-19 21:59:37 +02:00
Allan Odgaard
a0e297c3e0 Set custom name for the commit window document
This causes it to release its untitled token so that untitled documents created while the commit sheet is showing, does not appear to skip a number.
2014-10-19 21:59:25 +02:00
Ronald Wampler
8fd1e1088d Set path for the commit window document
This is so that the commit window’s text view sources project specific settings.
2014-10-19 21:52:26 +02:00
Allan Odgaard
e4bf017147 Ensure commit dialog attaches to the correct window 2014-10-13 23:20:24 +02:00
Allan Odgaard
e54a170eae NSBox is an implementation detail so use NSView instead 2014-09-25 19:33:17 +02:00
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