0

In relation to this answer, I'd like to know if there is an existing keyboard shortcut to validate the message instead of going to the checkmark and click on it. Otherwise, is it possible to put one in the keyboard shortcut interface?

I had a look at the shortcut keyboard interface but didn't see anything related to COMMIT_sth and when you don't know the inner name of the function...

EDIT: here is the interface I see, as soon as I click on the "Validation et envoi (push)" button. enter image description here

starball
  • 20,030
  • 7
  • 43
  • 238
  • I'm not sure what you mean by "validate the message". The checkmark to me opens up the text file "COMMIT_EDITMSG" for you to provide your commit message if you didn't already provide one in the source control pane. – Timothy G. May 15 '23 at 17:53
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 16 '23 at 02:01
  • In the version of VSC I use, as soon as I click on the "Validate and push" button (I guess it is something like that : mine is in French...), I have the COMMIT_EDITMSG which appears and I MUST click on the checkmark (located on the upper left part of the screen). I'd like to bind a shortcut keyboard to validate this checkmark. –  May 16 '23 at 08:40
  • @user: I've just tried and yes, it works! Thank you for your reply. I guess I let you write the answer? By the way, it is not intuitive to me because in general this shortcut triggers a closure and not a validation. In this case, I can see that the message is indeed reported on my git repo, so there has been a validation before the closure... –  May 22 '23 at 08:21

2 Answers2

0

A colleague gave me his own way of dealing with this interface which is slightly different than this version, and it gives a workaround to my problem: just put the message in the short "Message" input box on the left part (see image in the initial question) and validate with Enter.

Pro: It triggers the push of the code and I don't have to fly with the mouse to the checkmark.

Con: the input box is very tiny. I have to be sure about what I write and avoid making a mistake...

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
0

To complete the commit message editing, you need to use the "save" action for that editor tab, and then close that editor tab. Using your keyboard, that's probably ctrl/cmd+s to save, and then ctrl/cmd+w to close.

Yes, it's not very intuitive, but at least it's consistent: That's how it works for pretty much every commandline-based editor if you do git commits not using -m on the commandline (Ex. in vim or nano): You'll also need to save and close the editor buffer.

starball
  • 20,030
  • 7
  • 43
  • 238