-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native Commit window #1210
Native Commit window #1210
Conversation
I’ve long wanted the commit window to be native so I am really glad to see you take on this work. I haven’t yet studied the actual patch but for approach I would prefer that the interface remains backwards compatible. Mainly so that we do not have to update the dozen bundles or so, that use the current commit window. Presently the This means that it should be possible to simply change the variable’s value to point to another executable that communicates with TextMate (to bring up the window) similar to how bundle commands can use I think ideally the commit window code would be moved to the dialog plug-in, although for this, the dialog plug-in should link with the That said, if the workflow is changed, there will of course be problems providing a backwards compatible commit window, but I think the ideal workflow is still to bring up a window with listing of files with check boxes, potential actions, and a field for the message. I.e. committing directly from file browser is not really possible because we still need to ask for a commit message, so having the file list in that window might seem a little redundant but not really a distraction. As for embedding diff view’s in the SCM window: The current “API” for bringing up the commit window can take a list of commands that should be offered as actions per file, one of them is “diff”, so it seems to me that the current commit window would actually already be able to produce a diff (of checked files) based on the info it is already provided. |
I can btw help out with a skeleton for a replacement for |
Thank you. I will work along these lines. Do you prefer I close this pull Yes, the current commit window does produce diffs, but this is less than On Tue, Jan 28, 2014 at 10:23 AM, Allan Odgaard notifications@github.comwrote:
|
What I meant was just that the current commit window receive enough As for closing the pull request, I don’t mind if it’s kept open, it On 31 Jan 2014, at 4:10, Ronald Wampler wrote:
|
Please see the new commits. This version should be backward compatible with the current SCM bundles (only tested with git and hg repos). The UI is essentially the same as the current commit window, except we do not store previous commit messages and the --action-cmd buttons are now in a contextual menu. I used some of the code from the current commit-window (copyrights are included in the appropriate files) so I am not sure how this will effect lincensing if pulled directly into TM tree. |
Thanks, I have been using this for a few days, here’s what I have noticed:
And non-trivial stuff:
I can do the latter stuff, as I probably have a better idea of how to do that. I also don’t mind doing things from the first list, but since I consider this your project, I’ll await your input before I do anything. As for copying code from commit-window, I’m not sure how much of the code we’ll end up importing, if a lot, it would be best to add it as a submodule and then work on the actual commit-window repository, as we would then get the full commit history (which show exactly who did what, and why, rather than the copyright comment headers that just show who created the file in Xcode). Was there btw a reason for removing the inline table row buttons? I think having ‘diff’ as a one click action is nice (the “Modify” drop-down I’m less concerned about losing). Btw: to use this version, I added the following to Default.tmProperties:
|
Thanks. I would like to address the issues in the first list. The thought to do the setup in code did crossed my mind. If you can build out the skeleton to run this natively that would be great :). As for the inline table row buttons, I initially wanted to limit the amount of code copied from commit-window as much as possible. However, if in the end we decide to move this out to a submodule and work on commit-window, then I feel comfortable putting them back. But I would prefer to keep the "Modify" actions in the contextual menu. btw I did not realize that |
I have pushed commit 0c4f085 to the I also pushed a few commits to a As for No shortcut for “commit” (⌅) above, having used the I used |
Thanks, I have been working on merging these changes into the btw, I noticed that |
If you are calling ‘mate’ from TextMate itself, you must do this on I think you can do something like this:
0), ^{ As for NSPanel responding to cancel:, I think I normally have cancel: On 17 Mar 2014, at 22:21, Ronald Wampler wrote:
|
Thanks! The above worked. |
This allows the TM_COMMIT command line tool to open a window as “native”.
This is used by OakCommitWindow to determine which scm launched it. Also removed extraneous whitespaces.
Please see the new commits. Details are in the commit messages. Any feedback is appreciated as always. |
I had an issue with an exception (related to distributed objects) which so far seems to be fixed by 021367f. We may need to change from With respect to calling Otherwise no comments — let me know if you have any plans, otherwise I’ll review the code and merge it (after having used it a bit to ensure there are no regressions). It’s btw worth mentioning that TextMate does not show the HTML output window for commands with HTML output before the command writes something to stdout. This means the commit commands could delay the output window until after the commit window has been closed — though I had a quick look at Git → Commit… and it seems to be a larger project to make it act this way (might be easier to just recreate the commit command). |
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 now ⌘S. * The shortcut for cancelling a commit is now ⌘W.
OakCommitWindow is an NSPanel and therefore cannot become the main window, so bundle actions could not be performed via the bundle menu. Also, we avoid casting it explicitly as a instance of DocumentController for clarity. This change should be safe since other NSPanels (e.g., Find) do not respond to performBundleItem and it was being handle as a generic id anyways. E.g, bundle actions performed via the menu behave as expected for the BundleEditor, which responds to performBundleItem when the OakTextView is in focus for that window.
This is necessary for instances where OakTextView may not be in focus.
This allows other panels (e.g. find dialog and clipboard history) to interact with the OakTextView in the commit window.
Thanks, looking through my logs I had a similar exception. I pushed a new series up, the main changes were to incorporate your suggestions concerning the window style and using Besides, maybe, the diff name (perhaps |
I pushed a few changes to native-commit-window branch. I don’t see anything blocking this from going into master, so planning to merge later. Unless you have objections, I will likely squash some of the commits. |
The previous commit window also adds to history if user cancels the commit. I find this useful as writing a commit message sometimes makes you realize that further changes are needed, and thus you cancel but would like to re-use the commit message. Btw: I assume you looked to other sources for my coding style, I really appreciate this effort! The only thing you missed is that I use |
I look over the changes you made and appreciate the improvements. However, I ran into an issue with minimizing the commit window when Minimize windows into application icon is enabled. The window disappears after un-minimizing, but it is still in focus. Not sure if this is due to us using I don't have any objections, so please feel free to squash the commits as needed. You can drop 93c5658 to go back to the original behavior of ignoring NSPanels (maybe keep the |
Merged as d4882de...9018e8b — thanks a lot for your contributions! |
This is a proposal for a new native commit window (See screenshot below.). It should not be merge in yet (only git is currently support and that is the bare minimum), but I wanted some initial feedback, regrading the overall approach. If not I will break out the responsibility of committing back to the bundles (like the current commit window). However, since TextMate already knows about some SCMs, extending it to handle committing might not be too much of a stretch. Also, I wanted to try and take advantage of the nice diffs in the git bundle hence the HTMLOutputWindow.
I do not know the best way to launch it so adding it to the view menu along with key mapping are really only for convience.