# git-gui: CTRL/CMD + numpad ENTER does not invoke same command as "regular" ENTER

5 messages from 2018-03-01 to 2018-03-02. Participants: Birger Skogeng Pedersen, Eric Sunshine.
Thread: https://gitlist.dev/t/47951

## Birger Skogeng Pedersen, 2018-03-01 14:25

Subject: git-gui: CTRL/CMD + numpad ENTER does not invoke same command as "regular" ENTER
Message-ID: <CAGr--=LxMtz5RRP4742u3VsrADRsWARE2SitCSOWATySOn2LcQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAGr--%3DLxMtz5RRP4742u3VsrADRsWARE2SitCSOWATySOn2LcQ%40mail.gmail.com

```
In git-gui, we can hit CTRL/CMD+ENTER to create a commit. However,
using the numpad ENTER does not invoke the same command.

I propose that both numpad ENTER and "regular" ENTER should invoke the
same command.

```

## Birger Skogeng Pedersen, 2018-03-01 14:39

Subject: [PATCH] git-gui: bind CTRL/CMD+numpad ENTER to do_commit
Message-ID: <20180301143904.28652-1-birgersp@gmail.com>
URL: https://gitlist.dev/e/20180301143904.28652-1-birgersp%40gmail.com
In-Reply-To: <CAGr--=LxMtz5RRP4742u3VsrADRsWARE2SitCSOWATySOn2LcQ@mail.gmail.com>

```
---
 git-gui/git-gui.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 91c00e648..6de74ce63 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -3867,6 +3867,7 @@ bind .   <$M1B-Key-equal> {show_more_context;break}
 bind .   <$M1B-Key-plus> {show_more_context;break}
 bind .   <$M1B-Key-KP_Add> {show_more_context;break}
 bind .   <$M1B-Key-Return> do_commit
+bind .   <$M1B-Key-KP_Enter> do_commit
 foreach i [list $ui_index $ui_workdir] {
 	bind $i <Button-1>       { toggle_or_diff click %W %x %y; break }
 	bind $i <$M1B-Button-1>  { add_one_to_selection %W %x %y; break }
-- 
2.16.2.268.g7f9c27f2f.dirty


```

## Eric Sunshine, 2018-03-01 18:31

Subject: Re: [PATCH] git-gui: bind CTRL/CMD+numpad ENTER to do_commit
Message-ID: <CAPig+cRt+u4yEnFLM3kUB_J54Xvt6V9ceb6rwqfHC3kb=fttGg@mail.gmail.com>
URL: https://gitlist.dev/e/CAPig%2BcRt%2Bu4yEnFLM3kUB_J54Xvt6V9ceb6rwqfHC3kb%3DfttGg%40mail.gmail.com
In-Reply-To: <20180301143904.28652-1-birgersp@gmail.com>

```
On Thu, Mar 1, 2018 at 9:39 AM, Birger Skogeng Pedersen
<birgersp@gmail.com> wrote:
> ---

Please sign-off on your patch. See Documentation/SubmittingPatches.

Also, it would be helpful to write at least a short commit message
justifying the change. The reason you gave in your lead-in email[1]
might be sufficient:

    In git-gui, we can hit CTRL/CMD+ENTER to create a commit. However,
    using the numpad ENTER does not invoke the same command.

(assuming people don't argue that numpad ENTER should be saved for
some other function).

Thanks.

[1]: https://public-inbox.org/git/CAGr--=LxMtz5RRP4742u3VsrADRsWARE2SitCSOWATySOn2LcQ@mail.gmail.com/

> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
> index 91c00e648..6de74ce63 100755
> --- a/git-gui/git-gui.sh
> +++ b/git-gui/git-gui.sh
> @@ -3867,6 +3867,7 @@ bind .   <$M1B-Key-equal> {show_more_context;break}
>  bind .   <$M1B-Key-plus> {show_more_context;break}
>  bind .   <$M1B-Key-KP_Add> {show_more_context;break}
>  bind .   <$M1B-Key-Return> do_commit
> +bind .   <$M1B-Key-KP_Enter> do_commit
>  foreach i [list $ui_index $ui_workdir] {
>         bind $i <Button-1>       { toggle_or_diff click %W %x %y; break }
>         bind $i <$M1B-Button-1>  { add_one_to_selection %W %x %y; break }

```

## Birger Skogeng Pedersen, 2018-03-02 09:56

Subject: Re: [PATCH] git-gui: bind CTRL/CMD+numpad ENTER to do_commit
Message-ID: <CAGr--=JqXhwEtOrs0K3cscVa=LV75ejz=TYKtV7mgrd_96Jk6w@mail.gmail.com>
URL: https://gitlist.dev/e/CAGr--%3DJqXhwEtOrs0K3cscVa%3DLV75ejz%3DTYKtV7mgrd_96Jk6w%40mail.gmail.com
In-Reply-To: <CAPig+cRt+u4yEnFLM3kUB_J54Xvt6V9ceb6rwqfHC3kb=fttGg@mail.gmail.com>

```
Sorry about that. Version 2 coming right up.

On Thu, Mar 1, 2018 at 7:31 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
> On Thu, Mar 1, 2018 at 9:39 AM, Birger Skogeng Pedersen
> <birgersp@gmail.com> wrote:
>> ---
>
> Please sign-off on your patch. See Documentation/SubmittingPatches.
>
> Also, it would be helpful to write at least a short commit message
> justifying the change. The reason you gave in your lead-in email[1]
> might be sufficient:
>
>     In git-gui, we can hit CTRL/CMD+ENTER to create a commit. However,
>     using the numpad ENTER does not invoke the same command.
>
> (assuming people don't argue that numpad ENTER should be saved for
> some other function).
>
> Thanks.
>
> [1]: https://public-inbox.org/git/CAGr--=LxMtz5RRP4742u3VsrADRsWARE2SitCSOWATySOn2LcQ@mail.gmail.com/
>
>> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
>> index 91c00e648..6de74ce63 100755
>> --- a/git-gui/git-gui.sh
>> +++ b/git-gui/git-gui.sh
>> @@ -3867,6 +3867,7 @@ bind .   <$M1B-Key-equal> {show_more_context;break}
>>  bind .   <$M1B-Key-plus> {show_more_context;break}
>>  bind .   <$M1B-Key-KP_Add> {show_more_context;break}
>>  bind .   <$M1B-Key-Return> do_commit
>> +bind .   <$M1B-Key-KP_Enter> do_commit
>>  foreach i [list $ui_index $ui_workdir] {
>>         bind $i <Button-1>       { toggle_or_diff click %W %x %y; break }
>>         bind $i <$M1B-Button-1>  { add_one_to_selection %W %x %y; break }

```

## Birger Skogeng Pedersen, 2018-03-02 10:01

Subject: [PATCH v2] git-gui: bind CTRL/CMD+numpad ENTER to do_commit
Message-ID: <20180302100148.23899-1-birgersp@gmail.com>
URL: https://gitlist.dev/e/20180302100148.23899-1-birgersp%40gmail.com
In-Reply-To: <CAGr--=JqXhwEtOrs0K3cscVa=LV75ejz=TYKtV7mgrd_96Jk6w@mail.gmail.com>

```
CTRL/CMD+ENTER is bound to do_commit, but this did not apply for the
(numpad ENTER) key. To enable CTRL/CMD+ENTER and CTRL/CMD+(numpad ENTER)
to yield the same behaviour, CTRL/CMD+(numpad enter) has also been bound
to do_commit.

Signed-off-by: Birger Skogeng Pedersen <birgersp@gmail.com>
---
 git-gui/git-gui.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 91c00e648..6de74ce63 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -3867,6 +3867,7 @@ bind .   <$M1B-Key-equal> {show_more_context;break}
 bind .   <$M1B-Key-plus> {show_more_context;break}
 bind .   <$M1B-Key-KP_Add> {show_more_context;break}
 bind .   <$M1B-Key-Return> do_commit
+bind .   <$M1B-Key-KP_Enter> do_commit
 foreach i [list $ui_index $ui_workdir] {
 	bind $i <Button-1>       { toggle_or_diff click %W %x %y; break }
 	bind $i <$M1B-Button-1>  { add_one_to_selection %W %x %y; break }
-- 
2.16.2.270.gdc6133cf5


```
