{"thread":{"id":"44615","subject":"[BUG] git gui can't commit multiple files","startedAt":"2016-12-04T17:11:05Z","lastAt":"2017-12-03T15:06:10Z","messageCount":7,"participants":["Timon","David Aguilar","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"306896","messageId":"CANtxn9J9O+PADxpWa0JCcgwwk_tC5DuJGUruULN2fGP3knZ-Sw@mail.gmail.com","threadId":"44615","inReplyTo":null,"subject":"[BUG] git gui can't commit multiple files","fromName":"Timon","fromEmail":"timon37@gmail.com","sentAt":"2016-12-04T16:36:46Z","receivedAt":"2016-12-04T17:11:05Z","isPatch":false,"sender":{"key":"timon37@gmail.com","avatar":null},"body":"This is a regression in git 2.11.0 (version 2.10.2 is fine).\n\nIn git-gui I select multiple files in the Unstaged Changes (using\nshift+click) and press ctrl+t to stage them. Then only one files gets\nstaged instead of all of the selected files.\nThe same happens when unstaging files.\n\nGit-cola also exhibits the same behavior. Although there I could stage\nmultiple files if I used a popup menu instead of the keyboard shortcut\n(I'm guessing it goes through a different code path?).\n\nNote that I tested by reverting back to 2.10.2 and verified that\neverything works, so I'm quite certain that this is a regression in\ngit.\n"},{"id":"306899","messageId":"20161204204057.32dnkjx6ixv3swez@gmail.com","threadId":"44615","inReplyTo":"CANtxn9J9O+PADxpWa0JCcgwwk_tC5DuJGUruULN2fGP3knZ-Sw@mail.gmail.com","subject":"Re: [BUG] git gui can't commit multiple files","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2016-12-04T20:40:57Z","receivedAt":"2016-12-04T20:41:49Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Sun, Dec 04, 2016 at 05:36:46PM +0100, Timon wrote:\n> This is a regression in git 2.11.0 (version 2.10.2 is fine).\n> \n> In git-gui I select multiple files in the Unstaged Changes (using\n> shift+click) and press ctrl+t to stage them. Then only one files gets\n> staged instead of all of the selected files.\n> The same happens when unstaging files.\n> \n> Git-cola also exhibits the same behavior. Although there I could stage\n> multiple files if I used a popup menu instead of the keyboard shortcut\n> (I'm guessing it goes through a different code path?).\n\nCan you elaborate a bit?\n\nI just tested git-cola with Git 2.11 and it worked fine for me.\nI selected several files and used the Ctrl+s hotkey to stage the\nselected files.  They all got staged.\n\nIf you have a test repo, or reproduction recipe, I'd be curious\nto try it out.\n-- \nDavid\n"},{"id":"306943","messageId":"CANtxn9K9tzmbea1Dx9Z37GNfA9QfCX0gm-XHjJxieJN6bc6D-A@mail.gmail.com","threadId":"44615","inReplyTo":"20161204204057.32dnkjx6ixv3swez@gmail.com","subject":"Re: [BUG] git gui can't commit multiple files","fromName":"Timon","fromEmail":"timon37@gmail.com","sentAt":"2016-12-05T18:36:50Z","receivedAt":"2016-12-05T18:36:56Z","isPatch":false,"sender":{"key":"timon37@gmail.com","avatar":null},"body":"On 12/4/16, David Aguilar <davvid@gmail.com> wrote:\n> On Sun, Dec 04, 2016 at 05:36:46PM +0100, Timon wrote:\n>> This is a regression in git 2.11.0 (version 2.10.2 is fine).\n>>\n>> In git-gui I select multiple files in the Unstaged Changes (using\n>> shift+click) and press ctrl+t to stage them. Then only one files gets\n>> staged instead of all of the selected files.\n>> The same happens when unstaging files.\n>>\n>> Git-cola also exhibits the same behavior. Although there I could stage\n>> multiple files if I used a popup menu instead of the keyboard shortcut\n>> (I'm guessing it goes through a different code path?).\n>\n> Can you elaborate a bit?\n>\n> I just tested git-cola with Git 2.11 and it worked fine for me.\n> I selected several files and used the Ctrl+s hotkey to stage the\n> selected files.  They all got staged.\n>\n> If you have a test repo, or reproduction recipe, I'd be curious\n> to try it out.\n> --\n> David\n>\n\nCan you try with git gui?\nThough I guess it's probably specific to my distro or configuration.\nI'm running 64bit gentoo with:\nlinux 4.8.12\ngcc 5.4.0\nglibc 2.23-r3\ntk 8.6.6\ngettext 0.19.8.1\nopenssl 1.0.2j\nNot sure if that's helpful though.\n"},{"id":"333938","messageId":"CANtxn9KjTToqXKeO1mM8c6kD+jLf8QcAVXF46tX61uQB7YdKYA@mail.gmail.com","threadId":"44615","inReplyTo":"CANtxn9K9tzmbea1Dx9Z37GNfA9QfCX0gm-XHjJxieJN6bc6D-A@mail.gmail.com","subject":"Re: [BUG] git gui can't commit multiple files","fromName":"Timon","fromEmail":"timon37@gmail.com","sentAt":"2017-12-01T21:37:22Z","receivedAt":"2017-12-01T21:37:32Z","isPatch":false,"sender":{"key":"timon37@gmail.com","avatar":null},"body":"Originally I had this problem in gentoo and assumed in the end it's\nlikely due to my specific configuration.\nHowever recently I switched to nixos and am still experiencing it.\n\nI've search again if I can find anything and lo and behold, it's\nalready fixed in the *windows* version of git-gui...\n\nissue thread: https://github.com/git-for-windows/git/issues/1012\ncommit: https://github.com/git-for-windows/git/commit/1c4d4e7cbcf404c168df5537d55e9afd57f2b01b\n\nI applied it locally to git-2.15.0 and can confirm it fixed the problem for me.\nIf you need any more info/help from me, or would like me to test\nanything, feel free to ask.\n\nOn 12/5/16, Timon <timon37@gmail.com> wrote:\n> On 12/4/16, David Aguilar <davvid@gmail.com> wrote:\n>> On Sun, Dec 04, 2016 at 05:36:46PM +0100, Timon wrote:\n>>> This is a regression in git 2.11.0 (version 2.10.2 is fine).\n>>>\n>>> In git-gui I select multiple files in the Unstaged Changes (using\n>>> shift+click) and press ctrl+t to stage them. Then only one files gets\n>>> staged instead of all of the selected files.\n>>> The same happens when unstaging files.\n>>>\n>>> Git-cola also exhibits the same behavior. Although there I could stage\n>>> multiple files if I used a popup menu instead of the keyboard shortcut\n>>> (I'm guessing it goes through a different code path?).\n>>\n>> Can you elaborate a bit?\n>>\n>> I just tested git-cola with Git 2.11 and it worked fine for me.\n>> I selected several files and used the Ctrl+s hotkey to stage the\n>> selected files.  They all got staged.\n>>\n>> If you have a test repo, or reproduction recipe, I'd be curious\n>> to try it out.\n>> --\n>> David\n>>\n>\n> Can you try with git gui?\n> Though I guess it's probably specific to my distro or configuration.\n> I'm running 64bit gentoo with:\n> linux 4.8.12\n> gcc 5.4.0\n> glibc 2.23-r3\n> tk 8.6.6\n> gettext 0.19.8.1\n> openssl 1.0.2j\n> Not sure if that's helpful though.\n>\n"},{"id":"333947","messageId":"20171201234013.GD18220@aiede.mtv.corp.google.com","threadId":"44615","inReplyTo":"CANtxn9KjTToqXKeO1mM8c6kD+jLf8QcAVXF46tX61uQB7YdKYA@mail.gmail.com","subject":"[PATCH] git-gui: allow Ctrl+T to toggle multiple paths (Re: [BUG] git gui can't commit multiple files)","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2017-12-01T23:40:13Z","receivedAt":"2017-12-01T23:40:21Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\nSubject: git-gui: allow Ctrl+T to toggle multiple paths\n\nIn the Unstaged Changes panel, selecting multiple lines (using\nshift+click) and pressing ctrl+t to stage them causes one file to be\nstaged instead of all of the selected files.  The same also happens\nwhen unstaging files.\n\nThis regression appears to have been introduced by gitgui-0.21.0~7^2~1\n(Allow keyboard control to work in the staging widgets, 2016-10-01).\n\nAlso reported by zosrothko as a Git-for-Windows issue:\nhttps://github.com/git-for-windows/git/issues/1012\n\n[jn: fleshed out commit message]\n\nReported-by: Timon <timon37@gmail.com>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Jonathan Nieder <jrn@google.com>\n---\nHi Timon,\n\nTimon wrote:\n>>> On Sun, Dec 04, 2016 at 05:36:46PM +0100, Timon wrote:\n\n>>>> This is a regression in git 2.11.0 (version 2.10.2 is fine).\n>>>>\n>>>> In git-gui I select multiple files in the Unstaged Changes (using\n>>>> shift+click) and press ctrl+t to stage them. Then only one files gets\n>>>> staged instead of all of the selected files.\n>>>> The same happens when unstaging files.\n[...]\n> Originally I had this problem in gentoo and assumed in the end it's\n> likely due to my specific configuration.\n> However recently I switched to nixos and am still experiencing it.\n>\n> I've search again if I can find anything and lo and behold, it's\n> already fixed in the *windows* version of git-gui...\n>\n> issue thread: https://github.com/git-for-windows/git/issues/1012\n> commit: https://github.com/git-for-windows/git/commit/1c4d4e7cbcf404c168df5537d55e9afd57f2b01b\n>\n> I applied it locally to git-2.15.0 and can confirm it fixed the problem for me.\n> If you need any more info/help from me, or would like me to test\n> anything, feel free to ask.\n\nThanks for this pointer.  I'm including the patch here so the project\ncan consider applying it (it doesn't appear to have been sent upstream\nbefore).  I have not tested it or verified the claim it makes about\nwhat change introduced this regression --- if you're able to help with\nthat, that would be welcome.\n\nThanks,\nJonathan\n\n git-gui.sh | 13 +++++++++++++\n 1 file changed, 13 insertions(+)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex ed24aa9..ef98fc2 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -2501,6 +2501,19 @@ proc toggle_or_diff {mode w args} {\n \t\tset pos [split [$w index @$x,$y] .]\n \t\tforeach {lno col} $pos break\n \t} else {\n+\t\tif {$mode eq \"toggle\"} {\n+\t\t\tif {$w eq $ui_workdir} {\n+\t\t\t\tdo_add_selection\n+\t\t\t\tset last_clicked {}\n+\t\t\t\treturn\n+\t\t\t}\n+\t\t\tif {$w eq $ui_index} {\n+\t\t\t\tdo_unstage_selection\n+\t\t\t\tset last_clicked {}\n+\t\t\t\treturn\n+\t\t\t}\n+\t\t}\n+\n \t\tif {$last_clicked ne {}} {\n \t\t\tset lno [lindex $last_clicked 1]\n \t\t} else {\n-- \n2.15.0.531.g2ccb3012c9\n\n"},{"id":"333948","messageId":"20171201234556.GE18220@aiede.mtv.corp.google.com","threadId":"44615","inReplyTo":"20171201234013.GD18220@aiede.mtv.corp.google.com","subject":"Re: [PATCH] git-gui: allow Ctrl+T to toggle multiple paths (Re: [BUG] git gui can't commit multiple files)","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2017-12-01T23:45:56Z","receivedAt":"2017-12-01T23:46:07Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jonathan Nieder wrote:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Subject: git-gui: allow Ctrl+T to toggle multiple paths\n>\n> In the Unstaged Changes panel, selecting multiple lines (using\n> shift+click) and pressing ctrl+t to stage them causes one file to be\n> staged instead of all of the selected files.  The same also happens\n> when unstaging files.\n>\n> This regression appears to have been introduced by gitgui-0.21.0~7^2~1\n> (Allow keyboard control to work in the staging widgets, 2016-10-01).\n>\n> Also reported by zosrothko as a Git-for-Windows issue:\n> https://github.com/git-for-windows/git/issues/1012\n>\n> [jn: fleshed out commit message]\n>\n> Reported-by: Timon <timon37@gmail.com>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Signed-off-by: Jonathan Nieder <jrn@google.com>\n\nGah, this should say:\n\nSigned-off-by; Jonathan Nieder <jrnieder@gmail.com>\n\n[...]\n>> I applied it locally to git-2.15.0 and can confirm it fixed the problem for me.\n>> If you need any more info/help from me, or would like me to test\n>> anything, feel free to ask.\n>\n> Thanks for this pointer.  I'm including the patch here so the project\n> can consider applying it (it doesn't appear to have been sent upstream\n> before).  I have not tested it or verified the claim it makes about\n> what change introduced this regression --- if you're able to help with\n> that, that would be welcome.\n\nCan you bisect?  That is:\n\n git clone git://repo.or.cz/git-gui\n cd git-gui\n git bisect start\n git bisect good gitgui-0.20.0\n git bisect bad gitgui-0.21.0\n\nThen cut to the chase:\n\n git checkout gitgui-0.21.0~7^2~1\n ... test test test ...\n git bisect (good|bad)\n\n git checkout gitgui-0.21.0~7^2~1^\n ... test test test ...\n git bisect (good|bad)\n\nand follow the instructions if it suggests testing additional versions.\n\nThen I'll be happy to re-send the patch with the results from your\ntesting.\n\nThanks again,\nJonathan\n"},{"id":"333997","messageId":"CANtxn9+Ey8RpmcYojEp0Drf0b6Thb-6GxsKZSRmQEniFsE+k_g@mail.gmail.com","threadId":"44615","inReplyTo":"20171201234556.GE18220@aiede.mtv.corp.google.com","subject":"Re: [PATCH] git-gui: allow Ctrl+T to toggle multiple paths (Re: [BUG] git gui can't commit multiple files)","fromName":"Timon","fromEmail":"timon37@gmail.com","sentAt":"2017-12-03T15:06:02Z","receivedAt":"2017-12-03T15:06:10Z","isPatch":true,"sender":{"key":"timon37@gmail.com","avatar":null},"body":"On 12/2/17, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Jonathan Nieder wrote:\n>\n>> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>> Subject: git-gui: allow Ctrl+T to toggle multiple paths\n>>\n>> In the Unstaged Changes panel, selecting multiple lines (using\n>> shift+click) and pressing ctrl+t to stage them causes one file to be\n>> staged instead of all of the selected files.  The same also happens\n>> when unstaging files.\n>>\n>> This regression appears to have been introduced by gitgui-0.21.0~7^2~1\n>> (Allow keyboard control to work in the staging widgets, 2016-10-01).\n>>\n>> Also reported by zosrothko as a Git-for-Windows issue:\n>> https://github.com/git-for-windows/git/issues/1012\n>>\n>> [jn: fleshed out commit message]\n>>\n>> Reported-by: Timon <timon37@gmail.com>\n>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>> Signed-off-by: Jonathan Nieder <jrn@google.com>\n>\n> Gah, this should say:\n>\n> Signed-off-by; Jonathan Nieder <jrnieder@gmail.com>\n>\n> [...]\n>>> I applied it locally to git-2.15.0 and can confirm it fixed the problem\n>>> for me.\n>>> If you need any more info/help from me, or would like me to test\n>>> anything, feel free to ask.\n>>\n>> Thanks for this pointer.  I'm including the patch here so the project\n>> can consider applying it (it doesn't appear to have been sent upstream\n>> before).  I have not tested it or verified the claim it makes about\n>> what change introduced this regression --- if you're able to help with\n>> that, that would be welcome.\n>\n> Can you bisect?  That is:\n>\n>  git clone git://repo.or.cz/git-gui\n>  cd git-gui\n>  git bisect start\n>  git bisect good gitgui-0.20.0\n>  git bisect bad gitgui-0.21.0\n>\n> Then cut to the chase:\n>\n>  git checkout gitgui-0.21.0~7^2~1\n>  ... test test test ...\n>  git bisect (good|bad)\n>\n>  git checkout gitgui-0.21.0~7^2~1^\n>  ... test test test ...\n>  git bisect (good|bad)\n>\n> and follow the instructions if it suggests testing additional versions.\n>\n> Then I'll be happy to re-send the patch with the results from your\n> testing.\n>\n> Thanks again,\n> Jonathan\n>\n\nDid the testing and it went smoothly with the outcome:\n\n088ad75dc279614849f92e5ae0a2b579b26719eb is the first bad commit\ncommit 088ad75dc279614849f92e5ae0a2b579b26719eb\nAuthor: Pat Thoyts <patthoyts@users.sourceforge.net>\nDate:   Sat Oct 1 22:04:39 2016 +0100\n\n    Allow keyboard control to work in the staging widgets.\n\n    Keyboard focus was restricted to the commit message widget and users were\n    forced to use the mouse to select files in the workdir widget and only then\n    could use a key combination to stage the file.\n    It is now possible to use key navigation (Ctrl-Tab, arrow keys and Ctrl-T\n    or Ctrl-U) to stage and unstage files.\n    Suggested by @koppor in git-for-window/git issue #859\n\n    Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n\n:100755 100755 11048c7a0e94f598b168de98d18fda9aea420c7d\nec1cc43e8f73acd3d52047ece4dfab5edeb6ffb4 M\tgit-gui.sh\n"}]}