git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [BUG] git gui can't commit multiple files
@ 2016-12-04 16:36 Timon
  2016-12-04 20:40 ` David Aguilar
  0 siblings, 1 reply; 7+ messages in thread
From: Timon @ 2016-12-04 16:36 UTC (permalink / raw)
  To: git

This is a regression in git 2.11.0 (version 2.10.2 is fine).

In git-gui I select multiple files in the Unstaged Changes (using
shift+click) and press ctrl+t to stage them. Then only one files gets
staged instead of all of the selected files.
The same happens when unstaging files.

Git-cola also exhibits the same behavior. Although there I could stage
multiple files if I used a popup menu instead of the keyboard shortcut
(I'm guessing it goes through a different code path?).

Note that I tested by reverting back to 2.10.2 and verified that
everything works, so I'm quite certain that this is a regression in
git.

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

* Re: [BUG] git gui can't commit multiple files
  2016-12-04 16:36 [BUG] git gui can't commit multiple files Timon
@ 2016-12-04 20:40 ` David Aguilar
  2016-12-05 18:36   ` Timon
  0 siblings, 1 reply; 7+ messages in thread
From: David Aguilar @ 2016-12-04 20:40 UTC (permalink / raw)
  To: Timon; +Cc: git

On Sun, Dec 04, 2016 at 05:36:46PM +0100, Timon wrote:
> This is a regression in git 2.11.0 (version 2.10.2 is fine).
> 
> In git-gui I select multiple files in the Unstaged Changes (using
> shift+click) and press ctrl+t to stage them. Then only one files gets
> staged instead of all of the selected files.
> The same happens when unstaging files.
> 
> Git-cola also exhibits the same behavior. Although there I could stage
> multiple files if I used a popup menu instead of the keyboard shortcut
> (I'm guessing it goes through a different code path?).

Can you elaborate a bit?

I just tested git-cola with Git 2.11 and it worked fine for me.
I selected several files and used the Ctrl+s hotkey to stage the
selected files.  They all got staged.

If you have a test repo, or reproduction recipe, I'd be curious
to try it out.
-- 
David

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

* Re: [BUG] git gui can't commit multiple files
  2016-12-04 20:40 ` David Aguilar
@ 2016-12-05 18:36   ` Timon
  2017-12-01 21:37     ` Timon
  0 siblings, 1 reply; 7+ messages in thread
From: Timon @ 2016-12-05 18:36 UTC (permalink / raw)
  To: David Aguilar; +Cc: git

On 12/4/16, David Aguilar <davvid@gmail.com> wrote:
> On Sun, Dec 04, 2016 at 05:36:46PM +0100, Timon wrote:
>> This is a regression in git 2.11.0 (version 2.10.2 is fine).
>>
>> In git-gui I select multiple files in the Unstaged Changes (using
>> shift+click) and press ctrl+t to stage them. Then only one files gets
>> staged instead of all of the selected files.
>> The same happens when unstaging files.
>>
>> Git-cola also exhibits the same behavior. Although there I could stage
>> multiple files if I used a popup menu instead of the keyboard shortcut
>> (I'm guessing it goes through a different code path?).
>
> Can you elaborate a bit?
>
> I just tested git-cola with Git 2.11 and it worked fine for me.
> I selected several files and used the Ctrl+s hotkey to stage the
> selected files.  They all got staged.
>
> If you have a test repo, or reproduction recipe, I'd be curious
> to try it out.
> --
> David
>

Can you try with git gui?
Though I guess it's probably specific to my distro or configuration.
I'm running 64bit gentoo with:
linux 4.8.12
gcc 5.4.0
glibc 2.23-r3
tk 8.6.6
gettext 0.19.8.1
openssl 1.0.2j
Not sure if that's helpful though.

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

* Re: [BUG] git gui can't commit multiple files
  2016-12-05 18:36   ` Timon
@ 2017-12-01 21:37     ` Timon
  2017-12-01 23:40       ` [PATCH] git-gui: allow Ctrl+T to toggle multiple paths (Re: [BUG] git gui can't commit multiple files) Jonathan Nieder
  0 siblings, 1 reply; 7+ messages in thread
From: Timon @ 2017-12-01 21:37 UTC (permalink / raw)
  To: git

Originally I had this problem in gentoo and assumed in the end it's
likely due to my specific configuration.
However recently I switched to nixos and am still experiencing it.

I've search again if I can find anything and lo and behold, it's
already fixed in the *windows* version of git-gui...

issue thread: https://github.com/git-for-windows/git/issues/1012
commit: https://github.com/git-for-windows/git/commit/1c4d4e7cbcf404c168df5537d55e9afd57f2b01b

I applied it locally to git-2.15.0 and can confirm it fixed the problem for me.
If you need any more info/help from me, or would like me to test
anything, feel free to ask.

On 12/5/16, Timon <timon37@gmail.com> wrote:
> On 12/4/16, David Aguilar <davvid@gmail.com> wrote:
>> On Sun, Dec 04, 2016 at 05:36:46PM +0100, Timon wrote:
>>> This is a regression in git 2.11.0 (version 2.10.2 is fine).
>>>
>>> In git-gui I select multiple files in the Unstaged Changes (using
>>> shift+click) and press ctrl+t to stage them. Then only one files gets
>>> staged instead of all of the selected files.
>>> The same happens when unstaging files.
>>>
>>> Git-cola also exhibits the same behavior. Although there I could stage
>>> multiple files if I used a popup menu instead of the keyboard shortcut
>>> (I'm guessing it goes through a different code path?).
>>
>> Can you elaborate a bit?
>>
>> I just tested git-cola with Git 2.11 and it worked fine for me.
>> I selected several files and used the Ctrl+s hotkey to stage the
>> selected files.  They all got staged.
>>
>> If you have a test repo, or reproduction recipe, I'd be curious
>> to try it out.
>> --
>> David
>>
>
> Can you try with git gui?
> Though I guess it's probably specific to my distro or configuration.
> I'm running 64bit gentoo with:
> linux 4.8.12
> gcc 5.4.0
> glibc 2.23-r3
> tk 8.6.6
> gettext 0.19.8.1
> openssl 1.0.2j
> Not sure if that's helpful though.
>

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

* [PATCH] git-gui: allow Ctrl+T to toggle multiple paths (Re: [BUG] git gui can't commit multiple files)
  2017-12-01 21:37     ` Timon
@ 2017-12-01 23:40       ` Jonathan Nieder
  2017-12-01 23:45         ` Jonathan Nieder
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Nieder @ 2017-12-01 23:40 UTC (permalink / raw)
  To: Timon; +Cc: git, Johannes Schindelin, Pat Thoyts

From: Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: git-gui: allow Ctrl+T to toggle multiple paths

In the Unstaged Changes panel, selecting multiple lines (using
shift+click) and pressing ctrl+t to stage them causes one file to be
staged instead of all of the selected files.  The same also happens
when unstaging files.

This regression appears to have been introduced by gitgui-0.21.0~7^2~1
(Allow keyboard control to work in the staging widgets, 2016-10-01).

Also reported by zosrothko as a Git-for-Windows issue:
https://github.com/git-for-windows/git/issues/1012

[jn: fleshed out commit message]

Reported-by: Timon <timon37@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Jonathan Nieder <jrn@google.com>
---
Hi Timon,

Timon wrote:
>>> On Sun, Dec 04, 2016 at 05:36:46PM +0100, Timon wrote:

>>>> This is a regression in git 2.11.0 (version 2.10.2 is fine).
>>>>
>>>> In git-gui I select multiple files in the Unstaged Changes (using
>>>> shift+click) and press ctrl+t to stage them. Then only one files gets
>>>> staged instead of all of the selected files.
>>>> The same happens when unstaging files.
[...]
> Originally I had this problem in gentoo and assumed in the end it's
> likely due to my specific configuration.
> However recently I switched to nixos and am still experiencing it.
>
> I've search again if I can find anything and lo and behold, it's
> already fixed in the *windows* version of git-gui...
>
> issue thread: https://github.com/git-for-windows/git/issues/1012
> commit: https://github.com/git-for-windows/git/commit/1c4d4e7cbcf404c168df5537d55e9afd57f2b01b
>
> I applied it locally to git-2.15.0 and can confirm it fixed the problem for me.
> If you need any more info/help from me, or would like me to test
> anything, feel free to ask.

Thanks for this pointer.  I'm including the patch here so the project
can consider applying it (it doesn't appear to have been sent upstream
before).  I have not tested it or verified the claim it makes about
what change introduced this regression --- if you're able to help with
that, that would be welcome.

Thanks,
Jonathan

 git-gui.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/git-gui.sh b/git-gui.sh
index ed24aa9..ef98fc2 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -2501,6 +2501,19 @@ proc toggle_or_diff {mode w args} {
 		set pos [split [$w index @$x,$y] .]
 		foreach {lno col} $pos break
 	} else {
+		if {$mode eq "toggle"} {
+			if {$w eq $ui_workdir} {
+				do_add_selection
+				set last_clicked {}
+				return
+			}
+			if {$w eq $ui_index} {
+				do_unstage_selection
+				set last_clicked {}
+				return
+			}
+		}
+
 		if {$last_clicked ne {}} {
 			set lno [lindex $last_clicked 1]
 		} else {
-- 
2.15.0.531.g2ccb3012c9


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

* Re: [PATCH] git-gui: allow Ctrl+T to toggle multiple paths (Re: [BUG] git gui can't commit multiple files)
  2017-12-01 23:40       ` [PATCH] git-gui: allow Ctrl+T to toggle multiple paths (Re: [BUG] git gui can't commit multiple files) Jonathan Nieder
@ 2017-12-01 23:45         ` Jonathan Nieder
  2017-12-03 15:06           ` Timon
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Nieder @ 2017-12-01 23:45 UTC (permalink / raw)
  To: Timon; +Cc: git, Johannes Schindelin, Pat Thoyts

Jonathan Nieder wrote:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
> Subject: git-gui: allow Ctrl+T to toggle multiple paths
>
> In the Unstaged Changes panel, selecting multiple lines (using
> shift+click) and pressing ctrl+t to stage them causes one file to be
> staged instead of all of the selected files.  The same also happens
> when unstaging files.
>
> This regression appears to have been introduced by gitgui-0.21.0~7^2~1
> (Allow keyboard control to work in the staging widgets, 2016-10-01).
>
> Also reported by zosrothko as a Git-for-Windows issue:
> https://github.com/git-for-windows/git/issues/1012
>
> [jn: fleshed out commit message]
>
> Reported-by: Timon <timon37@gmail.com>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> Signed-off-by: Jonathan Nieder <jrn@google.com>

Gah, this should say:

Signed-off-by; Jonathan Nieder <jrnieder@gmail.com>

[...]
>> I applied it locally to git-2.15.0 and can confirm it fixed the problem for me.
>> If you need any more info/help from me, or would like me to test
>> anything, feel free to ask.
>
> Thanks for this pointer.  I'm including the patch here so the project
> can consider applying it (it doesn't appear to have been sent upstream
> before).  I have not tested it or verified the claim it makes about
> what change introduced this regression --- if you're able to help with
> that, that would be welcome.

Can you bisect?  That is:

 git clone git://repo.or.cz/git-gui
 cd git-gui
 git bisect start
 git bisect good gitgui-0.20.0
 git bisect bad gitgui-0.21.0

Then cut to the chase:

 git checkout gitgui-0.21.0~7^2~1
 ... test test test ...
 git bisect (good|bad)

 git checkout gitgui-0.21.0~7^2~1^
 ... test test test ...
 git bisect (good|bad)

and follow the instructions if it suggests testing additional versions.

Then I'll be happy to re-send the patch with the results from your
testing.

Thanks again,
Jonathan

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

* Re: [PATCH] git-gui: allow Ctrl+T to toggle multiple paths (Re: [BUG] git gui can't commit multiple files)
  2017-12-01 23:45         ` Jonathan Nieder
@ 2017-12-03 15:06           ` Timon
  0 siblings, 0 replies; 7+ messages in thread
From: Timon @ 2017-12-03 15:06 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Johannes Schindelin, Pat Thoyts

On 12/2/17, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Jonathan Nieder wrote:
>
>> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>> Subject: git-gui: allow Ctrl+T to toggle multiple paths
>>
>> In the Unstaged Changes panel, selecting multiple lines (using
>> shift+click) and pressing ctrl+t to stage them causes one file to be
>> staged instead of all of the selected files.  The same also happens
>> when unstaging files.
>>
>> This regression appears to have been introduced by gitgui-0.21.0~7^2~1
>> (Allow keyboard control to work in the staging widgets, 2016-10-01).
>>
>> Also reported by zosrothko as a Git-for-Windows issue:
>> https://github.com/git-for-windows/git/issues/1012
>>
>> [jn: fleshed out commit message]
>>
>> Reported-by: Timon <timon37@gmail.com>
>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
>> Signed-off-by: Jonathan Nieder <jrn@google.com>
>
> Gah, this should say:
>
> Signed-off-by; Jonathan Nieder <jrnieder@gmail.com>
>
> [...]
>>> I applied it locally to git-2.15.0 and can confirm it fixed the problem
>>> for me.
>>> If you need any more info/help from me, or would like me to test
>>> anything, feel free to ask.
>>
>> Thanks for this pointer.  I'm including the patch here so the project
>> can consider applying it (it doesn't appear to have been sent upstream
>> before).  I have not tested it or verified the claim it makes about
>> what change introduced this regression --- if you're able to help with
>> that, that would be welcome.
>
> Can you bisect?  That is:
>
>  git clone git://repo.or.cz/git-gui
>  cd git-gui
>  git bisect start
>  git bisect good gitgui-0.20.0
>  git bisect bad gitgui-0.21.0
>
> Then cut to the chase:
>
>  git checkout gitgui-0.21.0~7^2~1
>  ... test test test ...
>  git bisect (good|bad)
>
>  git checkout gitgui-0.21.0~7^2~1^
>  ... test test test ...
>  git bisect (good|bad)
>
> and follow the instructions if it suggests testing additional versions.
>
> Then I'll be happy to re-send the patch with the results from your
> testing.
>
> Thanks again,
> Jonathan
>

Did the testing and it went smoothly with the outcome:

088ad75dc279614849f92e5ae0a2b579b26719eb is the first bad commit
commit 088ad75dc279614849f92e5ae0a2b579b26719eb
Author: Pat Thoyts <patthoyts@users.sourceforge.net>
Date:   Sat Oct 1 22:04:39 2016 +0100

    Allow keyboard control to work in the staging widgets.

    Keyboard focus was restricted to the commit message widget and users were
    forced to use the mouse to select files in the workdir widget and only then
    could use a key combination to stage the file.
    It is now possible to use key navigation (Ctrl-Tab, arrow keys and Ctrl-T
    or Ctrl-U) to stage and unstage files.
    Suggested by @koppor in git-for-window/git issue #859

    Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

:100755 100755 11048c7a0e94f598b168de98d18fda9aea420c7d
ec1cc43e8f73acd3d52047ece4dfab5edeb6ffb4 M	git-gui.sh

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

end of thread, other threads:[~2017-12-03 15:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-04 16:36 [BUG] git gui can't commit multiple files Timon
2016-12-04 20:40 ` David Aguilar
2016-12-05 18:36   ` Timon
2017-12-01 21:37     ` Timon
2017-12-01 23:40       ` [PATCH] git-gui: allow Ctrl+T to toggle multiple paths (Re: [BUG] git gui can't commit multiple files) Jonathan Nieder
2017-12-01 23:45         ` Jonathan Nieder
2017-12-03 15:06           ` Timon

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).