git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
* feature request, git-gui: add hotkey to toggle amend/new
@ 2019-08-31 10:51 Birger Skogeng Pedersen
  2019-09-02 16:25 ` Birger Skogeng Pedersen
  0 siblings, 1 reply; 27+ messages in thread
From: Birger Skogeng Pedersen @ 2019-08-31 10:51 UTC (permalink / raw)
  To: Git List

In my pursuit to fully utilize git-gui with only using a keyboard, I
suggest that there is a hotkey to toggle between selecting "New
Commit" and "Amend Last Commit".

Not sure which key-combination that fits this purpose best, but my
suggestion is CTRL/CMD+Z.

Best regards,
Birger

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-08-31 10:51 feature request, git-gui: add hotkey to toggle amend/new Birger Skogeng Pedersen
@ 2019-09-02 16:25 ` Birger Skogeng Pedersen
  2019-09-02 18:07   ` Bert Wesarg
  0 siblings, 1 reply; 27+ messages in thread
From: Birger Skogeng Pedersen @ 2019-09-02 16:25 UTC (permalink / raw)
  To: Git List

I just now realized what a terrible suggestion CTRL+Z was.
I propose CTRL/CMD+E to toggle between amend/new commit.

On Sat, Aug 31, 2019 at 12:51 PM Birger Skogeng Pedersen
<birger.sp@gmail.com> wrote:
>
> In my pursuit to fully utilize git-gui with only using a keyboard, I
> suggest that there is a hotkey to toggle between selecting "New
> Commit" and "Amend Last Commit".
>
> Not sure which key-combination that fits this purpose best, but my
> suggestion is CTRL/CMD+Z.
>
> Best regards,
> Birger

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-02 16:25 ` Birger Skogeng Pedersen
@ 2019-09-02 18:07   ` Bert Wesarg
  2019-09-02 19:49     ` Birger Skogeng Pedersen
  2019-09-03  1:01     ` David
  0 siblings, 2 replies; 27+ messages in thread
From: Bert Wesarg @ 2019-09-02 18:07 UTC (permalink / raw)
  To: Birger Skogeng Pedersen; +Cc: Git List

Birger,

On Mon, Sep 2, 2019 at 6:25 PM Birger Skogeng Pedersen
<birger.sp@gmail.com> wrote:
>
> I just now realized what a terrible suggestion CTRL+Z was.
> I propose CTRL/CMD+E to toggle between amend/new commit.
>
> On Sat, Aug 31, 2019 at 12:51 PM Birger Skogeng Pedersen
> <birger.sp@gmail.com> wrote:
> >
> > In my pursuit to fully utilize git-gui with only using a keyboard, I
> > suggest that there is a hotkey to toggle between selecting "New
> > Commit" and "Amend Last Commit".
> >
> > Not sure which key-combination that fits this purpose best, but my
> > suggestion is CTRL/CMD+Z.

I think with your "focus" patch, this is not needed anymore:

After focusing the commit message widget, you can focus the radio
buttons with Tab/Shift+Tab and press Space.

I think this is short enough, so that wasting a Letter is not justified here.

Best,
Bert

> >
> > Best regards,
> > Birger

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-02 18:07   ` Bert Wesarg
@ 2019-09-02 19:49     ` Birger Skogeng Pedersen
  2019-09-02 19:56       ` [PATCH] Add hotkey to toggle "Amend Last Commit" radio selector Birger Skogeng Pedersen
  2019-09-02 20:12       ` feature request, git-gui: add hotkey to toggle amend/new Bert Wesarg
  2019-09-03  1:01     ` David
  1 sibling, 2 replies; 27+ messages in thread
From: Birger Skogeng Pedersen @ 2019-09-02 19:49 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: Git List

Hi Bert,


On Mon, Sep 2, 2019 at 8:08 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> I think with your "focus" patch, this is not needed anymore:
>
> After focusing the commit message widget, you can focus the radio
> buttons with Tab/Shift+Tab and press Space.
>
> I think this is short enough, so that wasting a Letter is not justified here.

Pressing the Tab key while the commit message widget is focused
inserts a tab in the commit message.
(Again, I'm on Windows so you might get different behaviour on Linux)

If the Tab key acted like you suggested, I agree it would not be
necessary with this a hotkey like this.


Best regards,
Birger

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH] Add hotkey to toggle "Amend Last Commit" radio selector
  2019-09-02 19:49     ` Birger Skogeng Pedersen
@ 2019-09-02 19:56       ` Birger Skogeng Pedersen
  2019-09-03  8:52         ` Bert Wesarg
  2019-09-02 20:12       ` feature request, git-gui: add hotkey to toggle amend/new Bert Wesarg
  1 sibling, 1 reply; 27+ messages in thread
From: Birger Skogeng Pedersen @ 2019-09-02 19:56 UTC (permalink / raw)
  To: git; +Cc: Birger Skogeng Pedersen

Selecting whether to do a "New Commit" or "Amend Last Commit" does not have
a hotkey.

With this patch, the user may toggle between the two options with
CTRL/CMD+e.

Signed-off-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
---
 git-gui.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/git-gui.sh b/git-gui.sh
index 5bc21b8..14be1e0 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -2640,6 +2640,16 @@ proc show_less_context {} {
 	}
 }
 
+proc toggle_commit_type {} {
+	global selected_commit_type
+	if {[string match amend* $selected_commit_type]} {
+		set selected_commit_type new
+	} else {
+		set selected_commit_type amend
+	}
+	do_select_commit_type
+}
+
 ######################################################################
 ##
 ## ui construction
@@ -3843,6 +3853,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-e> toggle_commit_type
 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.21.0.windows.1


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-02 19:49     ` Birger Skogeng Pedersen
  2019-09-02 19:56       ` [PATCH] Add hotkey to toggle "Amend Last Commit" radio selector Birger Skogeng Pedersen
@ 2019-09-02 20:12       ` Bert Wesarg
  2019-09-02 20:15         ` Bert Wesarg
  1 sibling, 1 reply; 27+ messages in thread
From: Bert Wesarg @ 2019-09-02 20:12 UTC (permalink / raw)
  To: Birger Skogeng Pedersen; +Cc: Git List

On Mon, Sep 2, 2019 at 9:49 PM Birger Skogeng Pedersen
<birger.sp@gmail.com> wrote:
>
> Hi Bert,
>
>
> On Mon, Sep 2, 2019 at 8:08 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> > I think with your "focus" patch, this is not needed anymore:
> >
> > After focusing the commit message widget, you can focus the radio
> > buttons with Tab/Shift+Tab and press Space.
> >
> > I think this is short enough, so that wasting a Letter is not justified here.
>
> Pressing the Tab key while the commit message widget is focused
> inserts a tab in the commit message.
> (Again, I'm on Windows so you might get different behaviour on Linux)
>
> If the Tab key acted like you suggested, I agree it would not be
> necessary with this a hotkey like this.

can we try to figure this out, before going forward with anything else?

Thanks.

Bert

>
>
> Best regards,
> Birger

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-02 20:12       ` feature request, git-gui: add hotkey to toggle amend/new Bert Wesarg
@ 2019-09-02 20:15         ` Bert Wesarg
  2019-09-03  5:37           ` Birger Skogeng Pedersen
  0 siblings, 1 reply; 27+ messages in thread
From: Bert Wesarg @ 2019-09-02 20:15 UTC (permalink / raw)
  To: Birger Skogeng Pedersen; +Cc: Git List

On Mon, Sep 2, 2019 at 10:12 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
>
> On Mon, Sep 2, 2019 at 9:49 PM Birger Skogeng Pedersen
> <birger.sp@gmail.com> wrote:
> >
> > Hi Bert,
> >
> >
> > On Mon, Sep 2, 2019 at 8:08 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> > > I think with your "focus" patch, this is not needed anymore:
> > >
> > > After focusing the commit message widget, you can focus the radio
> > > buttons with Tab/Shift+Tab and press Space.
> > >
> > > I think this is short enough, so that wasting a Letter is not justified here.
> >
> > Pressing the Tab key while the commit message widget is focused
> > inserts a tab in the commit message.

does Control-Tab works for traversal?

> > (Again, I'm on Windows so you might get different behaviour on Linux)
> >
> > If the Tab key acted like you suggested, I agree it would not be
> > necessary with this a hotkey like this.
>
> can we try to figure this out, before going forward with anything else?
>
> Thanks.
>
> Bert
>
> >
> >
> > Best regards,
> > Birger

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-02 18:07   ` Bert Wesarg
  2019-09-02 19:49     ` Birger Skogeng Pedersen
@ 2019-09-03  1:01     ` David
  2019-09-03  8:44       ` Bert Wesarg
  1 sibling, 1 reply; 27+ messages in thread
From: David @ 2019-09-03  1:01 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: Birger Skogeng Pedersen, Git List

On Tue, 3 Sep 2019 at 04:11, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> On Mon, Sep 2, 2019 at 6:25 PM Birger Skogeng Pedersen <birger.sp@gmail.com> wrote:
> > On Sat, Aug 31, 2019 at 12:51 PM Birger Skogeng Pedersen <birger.sp@gmail.com> wrote:

> > > In my pursuit to fully utilize git-gui with only using a keyboard, I
> > > suggest that there is a hotkey to toggle between selecting "New
> > > Commit" and "Amend Last Commit".

Hi, thanks for maintaining and contributing to git and git-gui, it's a
great tool!

> After focusing the commit message widget, you can focus the radio
> buttons with Tab/Shift+Tab and press Space.

> I think this is short enough, so that wasting a Letter is not
> justified here.

Ugh, may I express how unhappy I am to read that opinion from
the maintainer. I strongly disagree, please reconsider :(

And I enthusiastically support this initial request for a single
hotkey to immediately toggle between "New Commit" and "Amend Last
Commit". And it should work regardless of wherever the cursor or
highlight is currently active.

I have used git-gui for many years and I find this is actually the
most annoying and inconsistent aspect of its user interface. Sometimes
if one is lucky then "spacebar" will achieve it at startup or after
refresh, sometimes not. When I test here just now the suggested
tab/shift-tab/spacebar method, it does toggle but it also changes the
items in the staged changes list as an unwanted side effect. My
version says 0.20.0.8.gd000, but I have a few local patches (written
years ago) so sorry I am not testing with a version that you have, but
even so I wanted to report what I observed.

If one is often amending commit messages as I do during large
interactive rebases, it is painful to have to do some kind of
context-sensitive multi-key dance just to change from "New Commit" to
"Amend Last Commit". Especially when every other operation has become
a single keystroke in my muscle memory.

In my world it most definitely would not be "wasting a letter" to
implement this! It would instead be "OMG at last that got fixed for
everyone, hooray!" :D

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-02 20:15         ` Bert Wesarg
@ 2019-09-03  5:37           ` Birger Skogeng Pedersen
  2019-09-03 12:45             ` Pratyush Yadav
  0 siblings, 1 reply; 27+ messages in thread
From: Birger Skogeng Pedersen @ 2019-09-03  5:37 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: Git List, bouncingcats

On Mon, Sep 2, 2019 at 10:15 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> does Control-Tab works for traversal?


Bert,

Control+Tab works for traversal, but as a means to toggle new/amend
it's very tedious. I have to press Ctrl+Tab 9 times to select "new"
and 10 times to select "Amend"(!). Then 1 or 2 more times to go back
to the input area.
I sincerely doubt that this is your preferred method of switching
between new/amend. At this point we're better of letting go of the
keyboard and use the mouse, which is what I'm trying to avoid.

> I think this is short enough, so that wasting a Letter is not justified here.
I (also) often amend commits, so having a hotkey for this is quite a
necessity imo.


Birger

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-03  1:01     ` David
@ 2019-09-03  8:44       ` Bert Wesarg
  0 siblings, 0 replies; 27+ messages in thread
From: Bert Wesarg @ 2019-09-03  8:44 UTC (permalink / raw)
  To: David; +Cc: Birger Skogeng Pedersen, Git List

David,

On Tue, Sep 3, 2019 at 3:01 AM David <bouncingcats@gmail.com> wrote:
>
> On Tue, 3 Sep 2019 at 04:11, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> > On Mon, Sep 2, 2019 at 6:25 PM Birger Skogeng Pedersen <birger.sp@gmail.com> wrote:
> > > On Sat, Aug 31, 2019 at 12:51 PM Birger Skogeng Pedersen <birger.sp@gmail.com> wrote:
>
> > > > In my pursuit to fully utilize git-gui with only using a keyboard, I
> > > > suggest that there is a hotkey to toggle between selecting "New
> > > > Commit" and "Amend Last Commit".
>
> Hi, thanks for maintaining and contributing to git and git-gui, it's a
> great tool!
>
> > After focusing the commit message widget, you can focus the radio
> > buttons with Tab/Shift+Tab and press Space.
>
> > I think this is short enough, so that wasting a Letter is not
> > justified here.
>
> Ugh, may I express how unhappy I am to read that opinion from
> the maintainer. I strongly disagree, please reconsider :(
>
> And I enthusiastically support this initial request for a single
> hotkey to immediately toggle between "New Commit" and "Amend Last
> Commit". And it should work regardless of wherever the cursor or
> highlight is currently active.
>
> I have used git-gui for many years and I find this is actually the
> most annoying and inconsistent aspect of its user interface. Sometimes
> if one is lucky then "spacebar" will achieve it at startup or after
> refresh, sometimes not. When I test here just now the suggested
> tab/shift-tab/spacebar method, it does toggle but it also changes the
> items in the staged changes list as an unwanted side effect. My
> version says 0.20.0.8.gd000, but I have a few local patches (written
> years ago) so sorry I am not testing with a version that you have, but
> even so I wanted to report what I observed.
>
> If one is often amending commit messages as I do during large
> interactive rebases, it is painful to have to do some kind of
> context-sensitive multi-key dance just to change from "New Commit" to
> "Amend Last Commit". Especially when every other operation has become
> a single keystroke in my muscle memory.
>
> In my world it most definitely would not be "wasting a letter" to
> implement this! It would instead be "OMG at last that got fixed for
> everyone, hooray!" :D

thanks for the input. Though I'm not the maintainer.

Bert

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH] Add hotkey to toggle "Amend Last Commit" radio selector
  2019-09-02 19:56       ` [PATCH] Add hotkey to toggle "Amend Last Commit" radio selector Birger Skogeng Pedersen
@ 2019-09-03  8:52         ` Bert Wesarg
  2019-09-03 10:25           ` Bert Wesarg
  2019-09-03 16:20           ` Bert Wesarg
  0 siblings, 2 replies; 27+ messages in thread
From: Bert Wesarg @ 2019-09-03  8:52 UTC (permalink / raw)
  To: Birger Skogeng Pedersen; +Cc: Git Mailing List, David Aguilar, David

Birger,

On Mon, Sep 2, 2019 at 9:56 PM Birger Skogeng Pedersen
<birger.sp@gmail.com> wrote:
>
> Selecting whether to do a "New Commit" or "Amend Last Commit" does not have
> a hotkey.
>
> With this patch, the user may toggle between the two options with
> CTRL/CMD+e.

David A. (in Cc from git-cola) suggested, that we try to re-use
existing key bindings in Git GUIs. Here is Git-Cola hotkeys:

http://git-cola.github.io/share/doc/git-cola/hotkeys.html

and this indicates, that it already uses CTRL+m for "amend". Though
I'm unsure if this is a toggle like in git-gui or a one-shot. David
A., can you please clarify?

>
> Signed-off-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
> ---
>  git-gui.sh | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/git-gui.sh b/git-gui.sh
> index 5bc21b8..14be1e0 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -2640,6 +2640,16 @@ proc show_less_context {} {
>         }
>  }
>
> +proc toggle_commit_type {} {
> +       global selected_commit_type
> +       if {[string match amend* $selected_commit_type]} {
> +               set selected_commit_type new
> +       } else {
> +               set selected_commit_type amend
> +       }
> +       do_select_commit_type
> +}
> +
>  ######################################################################
>  ##
>  ## ui construction
> @@ -3843,6 +3853,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-e> toggle_commit_type

The commit type has also a two toggle menu entries (under "Commit")
they should now also indicate the key binding.
disable

Though how to express a toggle keybinding in the menu? I don't know if
you can assign the same keybinding to the same menu entry. Maybe we
need to add/remove the keybinding depending on the current mode.

Bert

>  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.21.0.windows.1
>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH] Add hotkey to toggle "Amend Last Commit" radio selector
  2019-09-03  8:52         ` Bert Wesarg
@ 2019-09-03 10:25           ` Bert Wesarg
  2019-09-03 16:20           ` Bert Wesarg
  1 sibling, 0 replies; 27+ messages in thread
From: Bert Wesarg @ 2019-09-03 10:25 UTC (permalink / raw)
  To: David Aguilar; +Cc: Git Mailing List, Birger Skogeng Pedersen, David

David,

On Tue, Sep 3, 2019 at 10:52 AM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
>
> Birger,
>
> On Mon, Sep 2, 2019 at 9:56 PM Birger Skogeng Pedersen
> <birger.sp@gmail.com> wrote:
> >
> > Selecting whether to do a "New Commit" or "Amend Last Commit" does not have
> > a hotkey.
> >
> > With this patch, the user may toggle between the two options with
> > CTRL/CMD+e.
>
> David A. (in Cc from git-cola) suggested, that we try to re-use
> existing key bindings in Git GUIs. Here is Git-Cola hotkeys:
>
> http://git-cola.github.io/share/doc/git-cola/hotkeys.html
>
> and this indicates, that it already uses CTRL+m for "amend". Though
> I'm unsure if this is a toggle like in git-gui or a one-shot. David
> A., can you please clarify?

git-gui already assigns CTRL+m to "Local merge…"

sorry. I think trying to synchronize the keybindings seems impossible.

Bert

>
> >
> > Signed-off-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
> > ---
> >  git-gui.sh | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> >
> > diff --git a/git-gui.sh b/git-gui.sh
> > index 5bc21b8..14be1e0 100755
> > --- a/git-gui.sh
> > +++ b/git-gui.sh
> > @@ -2640,6 +2640,16 @@ proc show_less_context {} {
> >         }
> >  }
> >
> > +proc toggle_commit_type {} {
> > +       global selected_commit_type
> > +       if {[string match amend* $selected_commit_type]} {
> > +               set selected_commit_type new
> > +       } else {
> > +               set selected_commit_type amend
> > +       }
> > +       do_select_commit_type
> > +}
> > +
> >  ######################################################################
> >  ##
> >  ## ui construction
> > @@ -3843,6 +3853,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-e> toggle_commit_type
>
> The commit type has also a two toggle menu entries (under "Commit")
> they should now also indicate the key binding.
> disable
>
> Though how to express a toggle keybinding in the menu? I don't know if
> you can assign the same keybinding to the same menu entry. Maybe we
> need to add/remove the keybinding depending on the current mode.
>
> Bert
>
> >  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.21.0.windows.1
> >

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-03  5:37           ` Birger Skogeng Pedersen
@ 2019-09-03 12:45             ` Pratyush Yadav
  2019-09-03 14:06               ` Birger Skogeng Pedersen
                                 ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Pratyush Yadav @ 2019-09-03 12:45 UTC (permalink / raw)
  To: Birger Skogeng Pedersen; +Cc: Bert Wesarg, Git List, bouncingcats

On 03/09/19 07:37AM, Birger Skogeng Pedersen wrote:
> On Mon, Sep 2, 2019 at 10:15 PM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> > does Control-Tab works for traversal?
> 
> 
> Bert,
> 
> Control+Tab works for traversal, but as a means to toggle new/amend
> it's very tedious. I have to press Ctrl+Tab 9 times to select "new"
> and 10 times to select "Amend"(!). Then 1 or 2 more times to go back
> to the input area.
> I sincerely doubt that this is your preferred method of switching
> between new/amend. At this point we're better of letting go of the
> keyboard and use the mouse, which is what I'm trying to avoid.
 
Can you try doing a Shift+Tab? For me on Linux, if I hit Shift+Tab, it 
immediately takes me to the "Amend last commit" option. Then I can press 
space to select it and Tab again to get back to the commit message.

Also, since we are on this topic, how about making the "Amend last 
commit" button a toggle instead? This would act as a "turn amend mode 
on/off" button. Since "Amend last commit" and "New Commit" are mutually 
exclusive, a single toggle to switch between those modes makes sense to 
me.

> > I think this is short enough, so that wasting a Letter is not 
> > justified here.
> I (also) often amend commits, so having a hotkey for this is quite a
> necessity imo.

Assuming the above works for you, do you still feel the need for a 
dedicated binding for amends?

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-03 12:45             ` Pratyush Yadav
@ 2019-09-03 14:06               ` Birger Skogeng Pedersen
  2019-09-03 17:34                 ` Pratyush Yadav
  2019-09-03 15:35               ` David
  2019-09-04  6:24               ` Johannes Sixt
  2 siblings, 1 reply; 27+ messages in thread
From: Birger Skogeng Pedersen @ 2019-09-03 14:06 UTC (permalink / raw)
  To: Pratyush Yadav; +Cc: Bert Wesarg, Git List, bouncingcats

Hi Pratyush,


On Tue, Sep 3, 2019 at 2:45 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> Can you try doing a Shift+Tab? For me on Linux, if I hit Shift+Tab, it
> immediately takes me to the "Amend last commit" option. Then I can press
> space to select it and Tab again to get back to the commit message.

It seems that Shift+Tab doesn't do anything (on Windows 10).
Regardless, imo there should be a binding dedicated to toggle amend.


> Also, since we are on this topic, how about making the "Amend last
> commit" button a toggle instead? This would act as a "turn amend mode
> on/off" button. Since "Amend last commit" and "New Commit" are mutually
> exclusive, a single toggle to switch between those modes makes sense to
> me.

I assume you're talking about the button in the "Commit" dropdown
menu. I agree, it could be just a single entry which is a toggle to
enable/disable amending. And (above the commit message dialog) perhaps
just a single checkbox; "Amend Last Commit". In other git GUIs (Git
Cola and TortoiseGit) I see they're using just a single checkbox for
this option. But maybe that is a slightly different topic, the hotkey
behaviour would remain the same.


> ... do you still feel the need for a dedicated binding for amends?

How do you guys feel about it? So far it seems we're at two "yay" and
one "nay". I really feel it is in the best interest of the git-gui
project to implement this hotkey. And not just because it is my
personal preference to have it :-)


Birger

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-03 12:45             ` Pratyush Yadav
  2019-09-03 14:06               ` Birger Skogeng Pedersen
@ 2019-09-03 15:35               ` David
  2019-09-03 17:27                 ` Pratyush Yadav
  2019-09-04  6:24               ` Johannes Sixt
  2 siblings, 1 reply; 27+ messages in thread
From: David @ 2019-09-03 15:35 UTC (permalink / raw)
  To: Pratyush Yadav; +Cc: Birger Skogeng Pedersen, Bert Wesarg, Git List

On Tue, 3 Sep 2019 at 22:45, Pratyush Yadav <me@yadavpratyush.com> wrote:
>
> Can you try doing a Shift+Tab? For me on Linux, if I hit Shift+Tab, it
> immediately takes me to the "Amend last commit" option. Then I can press
> space to select it and Tab again to get back to the commit message.

Hi Pratyush Yadav,

Yes, we know it can be done this way. The point being made is not
"this cannot be changed with the keyboard". We know that you can
fool around with the tab key and the shift key and the spacebar and
eventually you can succeed in changing this option.

And if you want to toggle it back again, you have to do a slightly
different keyboard dance, depending on where your cursor or
highlight is currently positioned.

Rather what we (at least I) am hoping to communicate is that after you
have done this many thousands of times, and you can do everything
else in git-gui very fast without touching the mouse, you might also join
us in wishing for action to be achievable with one hotkey-combination
event that does not affect any other state, it just toggles new/amend
commit, and is not a sequence of several multi-key actions which must
be adapted according to the current status of other input mode actions.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH] Add hotkey to toggle "Amend Last Commit" radio selector
  2019-09-03  8:52         ` Bert Wesarg
  2019-09-03 10:25           ` Bert Wesarg
@ 2019-09-03 16:20           ` Bert Wesarg
  1 sibling, 0 replies; 27+ messages in thread
From: Bert Wesarg @ 2019-09-03 16:20 UTC (permalink / raw)
  To: Birger Skogeng Pedersen; +Cc: Git Mailing List, David Aguilar, David

Birger,

On Tue, Sep 3, 2019 at 10:52 AM Bert Wesarg <bert.wesarg@googlemail.com> wrote:
>
> Birger,
>
> On Mon, Sep 2, 2019 at 9:56 PM Birger Skogeng Pedersen
> <birger.sp@gmail.com> wrote:
> >
> > Selecting whether to do a "New Commit" or "Amend Last Commit" does not have
> > a hotkey.
> >
> > With this patch, the user may toggle between the two options with
> > CTRL/CMD+e.
>
> David A. (in Cc from git-cola) suggested, that we try to re-use
> existing key bindings in Git GUIs. Here is Git-Cola hotkeys:
>
> http://git-cola.github.io/share/doc/git-cola/hotkeys.html
>
> and this indicates, that it already uses CTRL+m for "amend". Though
> I'm unsure if this is a toggle like in git-gui or a one-shot. David
> A., can you please clarify?
>
> >
> > Signed-off-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
> > ---
> >  git-gui.sh | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> >
> > diff --git a/git-gui.sh b/git-gui.sh
> > index 5bc21b8..14be1e0 100755
> > --- a/git-gui.sh
> > +++ b/git-gui.sh
> > @@ -2640,6 +2640,16 @@ proc show_less_context {} {
> >         }
> >  }
> >
> > +proc toggle_commit_type {} {
> > +       global selected_commit_type
> > +       if {[string match amend* $selected_commit_type]} {
> > +               set selected_commit_type new
> > +       } else {
> > +               set selected_commit_type amend
> > +       }
> > +       do_select_commit_type
> > +}
> > +
> >  ######################################################################
> >  ##
> >  ## ui construction
> > @@ -3843,6 +3853,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-e> toggle_commit_type
>
> The commit type has also a two toggle menu entries (under "Commit")
> they should now also indicate the key binding.
> disable
>
> Though how to express a toggle keybinding in the menu? I don't know if
> you can assign the same keybinding to the same menu entry. Maybe we
> need to add/remove the keybinding depending on the current mode.

that works. I squashed this into your commit and pushed to GitHub
(sorry, still no path-per-mail)

https://github.com/bertwesarg/git-gui/commit/245bb9944e3d1c6b266c58b56d316f283ed3516b

Bert

>
> Bert
>
> >  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.21.0.windows.1
> >

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-03 15:35               ` David
@ 2019-09-03 17:27                 ` Pratyush Yadav
  0 siblings, 0 replies; 27+ messages in thread
From: Pratyush Yadav @ 2019-09-03 17:27 UTC (permalink / raw)
  To: David; +Cc: Birger Skogeng Pedersen, Bert Wesarg, Git List

On 04/09/19 01:35AM, David wrote:
> On Tue, 3 Sep 2019 at 22:45, Pratyush Yadav <me@yadavpratyush.com> wrote:
> >
> > Can you try doing a Shift+Tab? For me on Linux, if I hit Shift+Tab, it
> > immediately takes me to the "Amend last commit" option. Then I can press
> > space to select it and Tab again to get back to the commit message.
> 
> Hi Pratyush Yadav,
> 
> Yes, we know it can be done this way. The point being made is not
> "this cannot be changed with the keyboard". We know that you can
> fool around with the tab key and the shift key and the spacebar and
> eventually you can succeed in changing this option.

Yes, but what Birger was saying was hitting Ctrl+Tab 9-10 times to get 
to the option. This is much faster than that alternative.

My aim was to let people know what options already exist before 
proposing new ones.
 
> And if you want to toggle it back again, you have to do a slightly
> different keyboard dance, depending on where your cursor or
> highlight is currently positioned.
> 
> Rather what we (at least I) am hoping to communicate is that after you
> have done this many thousands of times, and you can do everything
> else in git-gui very fast without touching the mouse, you might also join
> us in wishing for action to be achievable with one hotkey-combination
> event that does not affect any other state, it just toggles new/amend
> commit, and is not a sequence of several multi-key actions which must
> be adapted according to the current status of other input mode actions.

Don't get me wrong. I am not against having a dedicated hotkey for 
toggling amends. I think it is a common enough operation to warrant a 
dedicated keyboard toggle. I was just letting everyone know what the 
current options are, so they can make better judgements whether they 
really need this option or not.

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-03 14:06               ` Birger Skogeng Pedersen
@ 2019-09-03 17:34                 ` Pratyush Yadav
  0 siblings, 0 replies; 27+ messages in thread
From: Pratyush Yadav @ 2019-09-03 17:34 UTC (permalink / raw)
  To: Birger Skogeng Pedersen; +Cc: Bert Wesarg, Git List, bouncingcats

On 03/09/19 04:06PM, Birger Skogeng Pedersen wrote:
> Hi Pratyush,
> 
> 
> On Tue, Sep 3, 2019 at 2:45 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> > Can you try doing a Shift+Tab? For me on Linux, if I hit Shift+Tab, it
> > immediately takes me to the "Amend last commit" option. Then I can press
> > space to select it and Tab again to get back to the commit message.
> 
> It seems that Shift+Tab doesn't do anything (on Windows 10).

Ah, too bad.

> Regardless, imo there should be a binding dedicated to toggle amend.
> 
> > Also, since we are on this topic, how about making the "Amend last
> > commit" button a toggle instead? This would act as a "turn amend mode
> > on/off" button. Since "Amend last commit" and "New Commit" are mutually
> > exclusive, a single toggle to switch between those modes makes sense to
> > me.
> 
> I assume you're talking about the button in the "Commit" dropdown

Yes. That one and the two tick boxes on the top right of the commit 
message buffer/editor.

> menu. I agree, it could be just a single entry which is a toggle to
> enable/disable amending. And (above the commit message dialog) perhaps
> just a single checkbox; "Amend Last Commit". In other git GUIs (Git
> Cola and TortoiseGit) I see they're using just a single checkbox for
> this option. But maybe that is a slightly different topic, the hotkey
> behaviour would remain the same.

Yes, of course your patch is independent of the two-button behaviour. I 
was just pointing it out to see how others feel about it.

> 
> 
> > ... do you still feel the need for a dedicated binding for amends?
> 
> How do you guys feel about it? So far it seems we're at two "yay" and
> one "nay". I really feel it is in the best interest of the git-gui
> project to implement this hotkey. And not just because it is my
> personal preference to have it :-)

Well, I do think amending commits is a common enough operation to 
warrant a dedicated keyboard binding for it. So it is a "yay" for this 
feature from my side at least.

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-03 12:45             ` Pratyush Yadav
  2019-09-03 14:06               ` Birger Skogeng Pedersen
  2019-09-03 15:35               ` David
@ 2019-09-04  6:24               ` Johannes Sixt
  2019-09-04 17:46                 ` Pratyush Yadav
  2 siblings, 1 reply; 27+ messages in thread
From: Johannes Sixt @ 2019-09-04  6:24 UTC (permalink / raw)
  To: Pratyush Yadav, Birger Skogeng Pedersen
  Cc: Bert Wesarg, Git List, bouncingcats

Am 03.09.19 um 14:45 schrieb Pratyush Yadav:
> Can you try doing a Shift+Tab? For me on Linux, if I hit Shift+Tab, it 
> immediately takes me to the "Amend last commit" option. Then I can press 
> space to select it and Tab again to get back to the commit message.

That works on Windows with Ctrl+Shift+Tab, too.

> Also, since we are on this topic, how about making the "Amend last 
> commit" button a toggle instead? This would act as a "turn amend mode 
> on/off" button. Since "Amend last commit" and "New Commit" are mutually 
> exclusive, a single toggle to switch between those modes makes sense to 
> me.

That is worth a try. The check box title offers a natural hotkey then:
"_A_mend last commit", Alt-a.

-- Hannes

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-04  6:24               ` Johannes Sixt
@ 2019-09-04 17:46                 ` Pratyush Yadav
  2019-09-04 17:54                   ` Birger Skogeng Pedersen
  2019-09-04 18:52                   ` Johannes Sixt
  0 siblings, 2 replies; 27+ messages in thread
From: Pratyush Yadav @ 2019-09-04 17:46 UTC (permalink / raw)
  To: Johannes Sixt
  Cc: Birger Skogeng Pedersen, Bert Wesarg, Git List, bouncingcats

On 04/09/19 08:24AM, Johannes Sixt wrote:
> Am 03.09.19 um 14:45 schrieb Pratyush Yadav:
> > Can you try doing a Shift+Tab? For me on Linux, if I hit Shift+Tab, it 
> > immediately takes me to the "Amend last commit" option. Then I can press 
> > space to select it and Tab again to get back to the commit message.
> 
> That works on Windows with Ctrl+Shift+Tab, too.
> 
> > Also, since we are on this topic, how about making the "Amend last 
> > commit" button a toggle instead? This would act as a "turn amend mode 
> > on/off" button. Since "Amend last commit" and "New Commit" are mutually 
> > exclusive, a single toggle to switch between those modes makes sense to 
> > me.
> 
> That is worth a try. The check box title offers a natural hotkey then:
> "_A_mend last commit", Alt-a.

Right now, the binding proposed is Ctrl-e.  My mental model for the key 
bindings as of now is having the "actions" bound to Ctrl, and bindings 
that move you around in the UI bound to Alt.  So it makes more sense to 
me to have a "amend toggle" bound to Ctrl.  Maybe that's just me though.  
Anyone else care to chime in?

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-04 17:46                 ` Pratyush Yadav
@ 2019-09-04 17:54                   ` Birger Skogeng Pedersen
  2019-09-04 18:52                   ` Johannes Sixt
  1 sibling, 0 replies; 27+ messages in thread
From: Birger Skogeng Pedersen @ 2019-09-04 17:54 UTC (permalink / raw)
  To: Johannes Sixt, Pratyush Yadav; +Cc: Git List

Hi,

You could argue that A (as in "amend") makes quite an intuitive hotkey.
But personally I'm also leaning towards CTRL/CMD+E. The ALT+(letter)
combination is used to open a menu, for instance ALT+R opens
"Repository", ALT+E opens "Edit", etc. That's the behaviour on
Windows, anyways. So the hotkeys may seem a bit "mixed up" when
ALT+(some letter) opens the corresponding menu but ALT+A does
something quite different.

Birger

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-04 17:46                 ` Pratyush Yadav
  2019-09-04 17:54                   ` Birger Skogeng Pedersen
@ 2019-09-04 18:52                   ` Johannes Sixt
  2019-09-04 19:03                     ` Bert Wesarg
  1 sibling, 1 reply; 27+ messages in thread
From: Johannes Sixt @ 2019-09-04 18:52 UTC (permalink / raw)
  To: Pratyush Yadav
  Cc: Birger Skogeng Pedersen, Bert Wesarg, Git List, bouncingcats

Am 04.09.19 um 19:46 schrieb Pratyush Yadav:
> On 04/09/19 08:24AM, Johannes Sixt wrote:
>> That is worth a try. The check box title offers a natural hotkey then:
>> "_A_mend last commit", Alt-a.
> 
> Right now, the binding proposed is Ctrl-e.  My mental model for the key 
> bindings as of now is having the "actions" bound to Ctrl, and bindings 
> that move you around in the UI bound to Alt.  So it makes more sense to 
> me to have a "amend toggle" bound to Ctrl.  Maybe that's just me though.  
> Anyone else care to chime in?

"Amend last commit" is NOT an action. It switches a state.

It is common in Windows GUIs that every control, including menu items,
has a hotkey associated, the underlined letter in the caption, and the
hotkey to access that UI control is Alt+that letter. It's not
necessarily a matter of moving around.

And, BTW, this hotkey thing is also the case on my Linux desktop
(KDE-based).

But of course, git-gui is different and totally off track here. It has
*zero* controls marked for hotkey-accessibility. I was just hoping to
spark an effort to make some of the controls marked and hotkey-accessible.

-- Hannes

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-04 18:52                   ` Johannes Sixt
@ 2019-09-04 19:03                     ` Bert Wesarg
  2019-09-10  8:54                       ` David Aguilar
  0 siblings, 1 reply; 27+ messages in thread
From: Bert Wesarg @ 2019-09-04 19:03 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Pratyush Yadav, Birger Skogeng Pedersen, Git List, David

On Wed, Sep 4, 2019 at 8:52 PM Johannes Sixt <j6t@kdbg.org> wrote:
>
> Am 04.09.19 um 19:46 schrieb Pratyush Yadav:
> > On 04/09/19 08:24AM, Johannes Sixt wrote:
> >> That is worth a try. The check box title offers a natural hotkey then:
> >> "_A_mend last commit", Alt-a.
> >
> > Right now, the binding proposed is Ctrl-e.  My mental model for the key
> > bindings as of now is having the "actions" bound to Ctrl, and bindings
> > that move you around in the UI bound to Alt.  So it makes more sense to
> > me to have a "amend toggle" bound to Ctrl.  Maybe that's just me though.
> > Anyone else care to chime in?
>
> "Amend last commit" is NOT an action. It switches a state.
>
> It is common in Windows GUIs that every control, including menu items,
> has a hotkey associated, the underlined letter in the caption, and the
> hotkey to access that UI control is Alt+that letter. It's not
> necessarily a matter of moving around.
>
> And, BTW, this hotkey thing is also the case on my Linux desktop
> (KDE-based).
>
> But of course, git-gui is different and totally off track here. It has
> *zero* controls marked for hotkey-accessibility. I was just hoping to
> spark an effort to make some of the controls marked and hotkey-accessible.

I'm in favor of making this a checkbox, also in the menu. As all menu
entries have currently a CTRL+ binding assigned, I think this one
should have one too. As CTRL+A is taken, and the proposal is CTRL+E, I
would be fine with this. If the menus and the UX elements also honors
mnemonic now or in the future, I don't think they need to match the
CTRL+ binding. Thus if this gets Alt+A I'm fine with this too.

Bert

>
> -- Hannes

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-04 19:03                     ` Bert Wesarg
@ 2019-09-10  8:54                       ` David Aguilar
  2019-09-11 10:27                         ` Birger Skogeng Pedersen
  0 siblings, 1 reply; 27+ messages in thread
From: David Aguilar @ 2019-09-10  8:54 UTC (permalink / raw)
  To: Bert Wesarg
  Cc: Johannes Sixt, Pratyush Yadav, Birger Skogeng Pedersen, Git List, David

On Wed, Sep 04, 2019 at 09:03:02PM +0200, Bert Wesarg wrote:
> On Wed, Sep 4, 2019 at 8:52 PM Johannes Sixt <j6t@kdbg.org> wrote:
> >
> > Am 04.09.19 um 19:46 schrieb Pratyush Yadav:
> > > On 04/09/19 08:24AM, Johannes Sixt wrote:
> > >> That is worth a try. The check box title offers a natural hotkey then:
> > >> "_A_mend last commit", Alt-a.
> > >
> > > Right now, the binding proposed is Ctrl-e.  My mental model for the key
> > > bindings as of now is having the "actions" bound to Ctrl, and bindings
> > > that move you around in the UI bound to Alt.  So it makes more sense to
> > > me to have a "amend toggle" bound to Ctrl.  Maybe that's just me though.
> > > Anyone else care to chime in?
> >
> > "Amend last commit" is NOT an action. It switches a state.
> >
> > It is common in Windows GUIs that every control, including menu items,
> > has a hotkey associated, the underlined letter in the caption, and the
> > hotkey to access that UI control is Alt+that letter. It's not
> > necessarily a matter of moving around.
> >
> > And, BTW, this hotkey thing is also the case on my Linux desktop
> > (KDE-based).
> >
> > But of course, git-gui is different and totally off track here. It has
> > *zero* controls marked for hotkey-accessibility. I was just hoping to
> > spark an effort to make some of the controls marked and hotkey-accessible.
> 
> I'm in favor of making this a checkbox, also in the menu. As all menu
> entries have currently a CTRL+ binding assigned, I think this one
> should have one too. As CTRL+A is taken, and the proposal is CTRL+E, I
> would be fine with this. If the menus and the UX elements also honors
> mnemonic now or in the future, I don't think they need to match the
> CTRL+ binding. Thus if this gets Alt+A I'm fine with this too.
> 
> Bert
> 
> >
> > -- Hannes

git-gui might not be so focused on providing a fast way to launch a
visual $EDITOR, but Ctrl+E is the hotkey we use everywhere in git-cola
when lauching external editors on selected files.  Sometimes it's the
"hot" action so even "Enter" gets that action, but it's worth
considering if we ever want git-gui's status widget to be able to launch
editors.

We also let Ctrl+Enter launch the default xdg-open action on the
selected file (e.g. image files go to the default image editing program,
html files to a browser, etc).

While we're on the topic of hotkeys, some valuable hotkeys for an
English-centric keyboard are {J,K,L} because of the home row.

In web browsers, Ctrl-L is a very common hotkey for focusing the URL
input, so we stole that same hotkey for the "git log <...>" input
in the git-dag tool.  In that tool the arguments to "log" are very
much like a URL from the input perspective, so it's nice to be able
to use a familiar and convenient hotkey for that purpose.  The placement
of the input field[1] is also at the top of that tool, just like in a web
browser.

[1] https://git-cola.github.io/images/dag.png

Ctrl-L is also used to focus the "Commit summary" line edit for the main
git-cola commit message editor.  That seems like the most sensible
"main" behavior for the main commit GUI.  Maybe git-gui can do that too.

Ctrl-J is kinda like "down" in vim, and so we let that focus the "diff"
widget which is typically "down" below the status and commit widgets in
cola[2].

[2] https://git-cola.github.io/images/screenshot-dark-linux.png

Ctrl-K focuses the status widget because it's "up".  Also, K and L are
adjacent on the keyboard, and they are also adjacent visually in the UI
so there's a visual and muscle memory pairing there between the Status
and Commit widgets.

The JKL hotkeys are nice to have in addition to the numeric hotkeys
because they're so convenient.  In some cases (like when the diff widget
is focused) we allow Alt-{J,K} to jump down/up (next/prev) between the
files in the status widget, otherwise regular {J,K} can be used if it
has focus.

Thanks for at least trying to keep some parity with git-cola's hotkeys.
It's not completely possible in all situations, but it's good to at
least share notes on how we use the GUI.
-- 
David

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-10  8:54                       ` David Aguilar
@ 2019-09-11 10:27                         ` Birger Skogeng Pedersen
  2019-09-11 18:34                           ` Pratyush Yadav
  0 siblings, 1 reply; 27+ messages in thread
From: Birger Skogeng Pedersen @ 2019-09-11 10:27 UTC (permalink / raw)
  To: Pratyush Yadav; +Cc: Bert Wesarg, Git List

Hi Pratyush,

I'm hoping this will be merged, even without changing the radio
selectors to a checkbox(?). The patch from Bert resolves the issue I
raised about wanting the hotkey.
What do you think?

Birger

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-11 10:27                         ` Birger Skogeng Pedersen
@ 2019-09-11 18:34                           ` Pratyush Yadav
  2019-09-11 18:47                             ` Pratyush Yadav
  0 siblings, 1 reply; 27+ messages in thread
From: Pratyush Yadav @ 2019-09-11 18:34 UTC (permalink / raw)
  To: Birger Skogeng Pedersen; +Cc: Bert Wesarg, Git List

On 11/09/19 12:27PM, Birger Skogeng Pedersen wrote:
> Hi Pratyush,
> 
> I'm hoping this will be merged, even without changing the radio
> selectors to a checkbox(?). The patch from Bert resolves the issue I
> raised about wanting the hotkey.
> What do you think?

What do you mean by "this"? I am guessing you mean [0].

I'm afraid that patch conflicts with Bert's change [1] to using a 
checkbox. Since both patches are in flight, it makes more sense to base 
your work off his. If I merge your patch now, I'll have to revert it as 
soon as it is time to merge Bert's, and then rework your patch.

Also, after Bert's patch, the toggling becomes much simpler. All you'd 
have to do is something like:

  bind . <$M1B-Key-e> {
	# Toggle commit type.
	set commit_type_is_amend [expr {!$commit_type_is_amend}]
	do_select_commit_type
  }

Maybe a cleaner way is possible, but this is what I could come up with 
for toggling a boolean.

So can you please send a re-roll based on Bert's patch? I took a quick 
glance at it, and it seems mostly correct. I have a couple of comments, 
so some things might change based on the discussion, but I don't think 
it should affect your change too much.

[0] https://public-inbox.org/git/20190904175943.11924-1-birger.sp@gmail.com/
[1] https://public-inbox.org/git/ab1f68cc8552e405c9d04622be1e728ab81bda17.1567713659.git.bert.wesarg@googlemail.com/

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: feature request, git-gui: add hotkey to toggle amend/new
  2019-09-11 18:34                           ` Pratyush Yadav
@ 2019-09-11 18:47                             ` Pratyush Yadav
  0 siblings, 0 replies; 27+ messages in thread
From: Pratyush Yadav @ 2019-09-11 18:47 UTC (permalink / raw)
  To: Birger Skogeng Pedersen; +Cc: Bert Wesarg, Git List

On 12/09/19 12:04AM, Pratyush Yadav wrote:
> On 11/09/19 12:27PM, Birger Skogeng Pedersen wrote:
> > Hi Pratyush,
> > 
> > I'm hoping this will be merged, even without changing the radio
> > selectors to a checkbox(?). The patch from Bert resolves the issue I
> > raised about wanting the hotkey.
> > What do you think?
> 
> What do you mean by "this"? I am guessing you mean [0].
> 
> I'm afraid that patch conflicts with Bert's change [1] to using a 
> checkbox. Since both patches are in flight, it makes more sense to base 
> your work off his. If I merge your patch now, I'll have to revert it as 
> soon as it is time to merge Bert's, and then rework your patch.
> 
> Also, after Bert's patch, the toggling becomes much simpler. All you'd 
> have to do is something like:
> 
>   bind . <$M1B-Key-e> {
> 	# Toggle commit type.
> 	set commit_type_is_amend [expr {!$commit_type_is_amend}]
> 	do_select_commit_type
>   }

I forgot to mention one more thing. You'd also want to mark the menu 
entry of the amend toggle with Ctrl+e keybinding, like we do for all 
other bindings (F5 for rescan, Ctrl+T for staging, etc.).

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, back to index

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-31 10:51 feature request, git-gui: add hotkey to toggle amend/new Birger Skogeng Pedersen
2019-09-02 16:25 ` Birger Skogeng Pedersen
2019-09-02 18:07   ` Bert Wesarg
2019-09-02 19:49     ` Birger Skogeng Pedersen
2019-09-02 19:56       ` [PATCH] Add hotkey to toggle "Amend Last Commit" radio selector Birger Skogeng Pedersen
2019-09-03  8:52         ` Bert Wesarg
2019-09-03 10:25           ` Bert Wesarg
2019-09-03 16:20           ` Bert Wesarg
2019-09-02 20:12       ` feature request, git-gui: add hotkey to toggle amend/new Bert Wesarg
2019-09-02 20:15         ` Bert Wesarg
2019-09-03  5:37           ` Birger Skogeng Pedersen
2019-09-03 12:45             ` Pratyush Yadav
2019-09-03 14:06               ` Birger Skogeng Pedersen
2019-09-03 17:34                 ` Pratyush Yadav
2019-09-03 15:35               ` David
2019-09-03 17:27                 ` Pratyush Yadav
2019-09-04  6:24               ` Johannes Sixt
2019-09-04 17:46                 ` Pratyush Yadav
2019-09-04 17:54                   ` Birger Skogeng Pedersen
2019-09-04 18:52                   ` Johannes Sixt
2019-09-04 19:03                     ` Bert Wesarg
2019-09-10  8:54                       ` David Aguilar
2019-09-11 10:27                         ` Birger Skogeng Pedersen
2019-09-11 18:34                           ` Pratyush Yadav
2019-09-11 18:47                             ` Pratyush Yadav
2019-09-03  1:01     ` David
2019-09-03  8:44       ` Bert Wesarg

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox