Re: Keyboard shortcut for 'Commit'?

45 views
Skip to first unread message

David Aguilar

unread,
Feb 7, 2013, 3:52:21 AM2/7/13
to Dmitry Kann, git-...@googlegroups.com
On Wed, Feb 6, 2013 at 5:26 AM, Dmitry Kann <dmitr...@gmail.com> wrote:
> Does anyone know a keyboard shortcut for the Commit button?
>
> Every other command has a corresponding menu item, you can see shortcuts
> there, you can use the underlined char with Alt. But nothing of that kind
> for the Commit button. I tried literally everything: Alt+C, Ctrl+Enter,
> nope. I can't believe you can only click it with the mouse...

Ctrl+Enter or Cmd+Enter on OS X.
--
David

Dmitry Kann

unread,
Feb 7, 2013, 3:54:27 AM2/7/13
to David Aguilar, git-...@googlegroups.com
Hi David,

Neither of them works in my Ubuntu...


Kind regards / Met vriendelijke groeten,
Dmitry

Uri O'krent

unread,
Feb 7, 2013, 3:58:10 AM2/7/13
to Dmitry Kann, David Aguilar, git-...@googlegroups.com
> Neither of them works in my Ubuntu...

Are you sure you don't have any custom keyboard settings or shortcuts?
I *always* use ctrl-enter to commit on Ubuntu.

Dmitry Kann

unread,
Feb 7, 2013, 4:01:15 AM2/7/13
to Uri O'krent, David Aguilar, git-...@googlegroups.com
No, pure vanilla git-cola install, and Ctrl+Enter works OK in other apps. Can I reassign them somehow, or at least check whether the keyboard bindings are correct?

Kind regards / Met vriendelijke groeten,
Dmitry


David Aguilar

unread,
Feb 7, 2013, 4:02:19 AM2/7/13
to Dmitry Kann, git-...@googlegroups.com
Hmm I wonder if you're perhaps hitting Ctrl+Return?

You said you tried Ctrl+Enter, which is why I wonder.

It's *supposed* to work... as in, I use it everyday.

Older versions did not have this feature. Maybe you have an old version?


It could also be an oversight in the code.
Here's where we set the shortcut for that action in cola/widgets/commitmsg.py:

self.commit_action = add_action(self, 'Commit@@verb',
self.commit,
'Ctrl+Return')

Does it behave differently if you change that to Ctrl+Enter?
--
David

Uri O'krent

unread,
Feb 7, 2013, 4:04:13 AM2/7/13
to David Aguilar, Dmitry Kann, git-...@googlegroups.com
something else I've noticed is that focus might need to be in the
commit message pane for the shortcut to work.

--
Uri

Please consider the environment before printing this message.
http://wwf.panda.org/savepaper/

Dmitry Kann

unread,
Feb 8, 2013, 4:37:16 PM2/8/13
to David Aguilar, git-...@googlegroups.com
I couldn't find the file you mentioned (commitmsg.py)

All I managed to find in /usr/share/git-cola/lib/cola/views/mainwindow.py:

Line 74:

        # Sign off and commit buttons
        self.signoff_button = qt.create_toolbutton(self,
                                                   text='Sign Off',
                                                   tooltip='Sign off on this commit',
                                                   icon=qtutils.apply_icon())

        self.commit_button = qt.create_toolbutton(self,
                                                  text='Commit@@verb',
                                                  tooltip='Commit staged changes',
                                                  icon=qtutils.save_icon())

But there seems to be no shortcut defined. It's Git-cola 1.4.3.5 from Quantal's reps (maybe the version is too old?)


Kind regards / Met vriendelijke groeten,
Dmitry


Dmitry Kann

unread,
Feb 8, 2013, 4:49:30 PM2/8/13
to David Aguilar, git-...@googlegroups.com
After upgrade to 1.8.1 Ctrl+Return works indeed. Sorry for confusion.

It's just a pity Quantal's version is so outdated. Do you maybe have in plans to set up a PPA?

Kind regards / Met vriendelijke groeten,
Dmitry


Reply all
Reply to author
Forward
0 new messages