{"thread":{"id":"28673","subject":"[PATCH] git-gui: fix multi selected file operation","startedAt":"2011-10-14T08:19:26Z","lastAt":"2011-10-18T08:13:54Z","messageCount":6,"participants":["Bert Wesarg","Pat Thoyts"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"177627","messageId":"87cab38f99075f149a9abe7caf4ec139a0a48213.1318580310.git.bert.wesarg@googlemail.com","threadId":"28673","inReplyTo":null,"subject":"[PATCH] git-gui: fix multi selected file operation","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2011-10-14T08:19:26Z","receivedAt":"2011-10-14T08:19:26Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"The current path for what we see the diff is not in the list of selected\npaths. But when we add single paths (with Ctrl) to the set the current path\nwould not be used when the action is performed.\n\nFix this by explicitly putting the path into the list before we start\nshowing the diff.\n\nSigned-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n---\n git-gui.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex f897160..e5dd8bc 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -2474,6 +2474,7 @@ proc toggle_or_diff {w x y} {\n \t\t\t\t[concat $after [list ui_ready]]\n \t\t}\n \t} else {\n+\t\tset selected_paths($path) 1\n \t\tshow_diff $path $w $lno\n \t}\n }\n-- \n1.7.6.789.gb4599\n"},{"id":"177753","messageId":"87ehydhnwk.fsf@fox.patthoyts.tk","threadId":"28673","inReplyTo":"87cab38f99075f149a9abe7caf4ec139a0a48213.1318580310.git.bert.wesarg@googlemail.com","subject":"Re: [PATCH] git-gui: fix multi selected file operation","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-10-15T22:48:27Z","receivedAt":"2011-10-15T22:48:27Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Bert Wesarg <bert.wesarg@googlemail.com> writes:\n\n>The current path for what we see the diff is not in the list of selected\n>paths. But when we add single paths (with Ctrl) to the set the current path\n>would not be used when the action is performed.\n>\n>Fix this by explicitly putting the path into the list before we start\n>showing the diff.\n>\n>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n>---\n> git-gui.sh |    1 +\n> 1 files changed, 1 insertions(+), 0 deletions(-)\n>\n>diff --git a/git-gui.sh b/git-gui.sh\n>index f897160..e5dd8bc 100755\n>--- a/git-gui.sh\n>+++ b/git-gui.sh\n>@@ -2474,6 +2474,7 @@ proc toggle_or_diff {w x y} {\n> \t\t\t\t[concat $after [list ui_ready]]\n> \t\t}\n> \t} else {\n>+\t\tset selected_paths($path) 1\n> \t\tshow_diff $path $w $lno\n> \t}\n> }\n\nIt is not clear what I should be looking for to test this. Can you\nre-write the commit message to be more clear about what you are\nfixing. Is this multiple unstaged files in the staging box? If so I\ndon't see what path display is changing.\n\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"},{"id":"177835","messageId":"CAKPyHN0iaS301r_d+kc-AVRNVKUprhdMwDpdD0HDf7nKbsPR3Q@mail.gmail.com","threadId":"28673","inReplyTo":"87ehydhnwk.fsf@fox.patthoyts.tk","subject":"Re: [PATCH] git-gui: fix multi selected file operation","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2011-10-17T05:54:10Z","receivedAt":"2011-10-17T05:54:10Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"Hi,\n\nOn Sun, Oct 16, 2011 at 00:48, Pat Thoyts\n<patthoyts@users.sourceforge.net> wrote:\n> Bert Wesarg <bert.wesarg@googlemail.com> writes:\n>\n>>The current path for what we see the diff is not in the list of selected\n>>paths. But when we add single paths (with Ctrl) to the set the current path\n>>would not be used when the action is performed.\n>>\n>>Fix this by explicitly putting the path into the list before we start\n>>showing the diff.\n>>\n>>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n>>---\n>> git-gui.sh |    1 +\n>> 1 files changed, 1 insertions(+), 0 deletions(-)\n>>\n>>diff --git a/git-gui.sh b/git-gui.sh\n>>index f897160..e5dd8bc 100755\n>>--- a/git-gui.sh\n>>+++ b/git-gui.sh\n>>@@ -2474,6 +2474,7 @@ proc toggle_or_diff {w x y} {\n>>                               [concat $after [list ui_ready]]\n>>               }\n>>       } else {\n>>+              set selected_paths($path) 1\n>>               show_diff $path $w $lno\n>>       }\n>> }\n>\n> It is not clear what I should be looking for to test this. Can you\n> re-write the commit message to be more clear about what you are\n> fixing. Is this multiple unstaged files in the staging box? If so I\n> don't see what path display is changing.\n\nSorry, for this bad description. I will give you a recipe here what to\ndo to expose the problem. I try later to form this into a new commit\nmessage:\n\nYou have 2 modified, not staged files A and B. Your current view shows\nthe diff for A. Adding B to the selection via Ctrl+Button1 and than\nperform the \"Stage To Commit\" action from the \"Commit\" menu results\nonly in the staging of B.\n\nNote, using Shift+Button1 (i.e. 'adding a range of files to the\nselection') results in the staging of both files A and B.\n\nBert\n\n>\n> --\n> Pat Thoyts                            http://www.patthoyts.tk/\n> PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n>\n"},{"id":"177902","messageId":"877h43l0f3.fsf@fox.patthoyts.tk","threadId":"28673","inReplyTo":"CAKPyHN0iaS301r_d+kc-AVRNVKUprhdMwDpdD0HDf7nKbsPR3Q@mail.gmail.com","subject":"Re: [PATCH] git-gui: fix multi selected file operation","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-10-17T22:26:40Z","receivedAt":"2011-10-17T22:26:40Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Bert Wesarg <bert.wesarg@googlemail.com> writes:\n\n>Hi,\n>\n>On Sun, Oct 16, 2011 at 00:48, Pat Thoyts\n><patthoyts@users.sourceforge.net> wrote:\n>> Bert Wesarg <bert.wesarg@googlemail.com> writes:\n>>\n>>>The current path for what we see the diff is not in the list of selected\n>>>paths. But when we add single paths (with Ctrl) to the set the current path\n>>>would not be used when the action is performed.\n>>>\n>>>Fix this by explicitly putting the path into the list before we start\n>>>showing the diff.\n>>>\n>>>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n>>>---\n>>> git-gui.sh |    1 +\n>>> 1 files changed, 1 insertions(+), 0 deletions(-)\n>>>\n>>>diff --git a/git-gui.sh b/git-gui.sh\n>>>index f897160..e5dd8bc 100755\n>>>--- a/git-gui.sh\n>>>+++ b/git-gui.sh\n>>>@@ -2474,6 +2474,7 @@ proc toggle_or_diff {w x y} {\n>>>                               [concat $after [list ui_ready]]\n>>>               }\n>>>       } else {\n>>>+              set selected_paths($path) 1\n>>>               show_diff $path $w $lno\n>>>       }\n>>> }\n>>\n>> It is not clear what I should be looking for to test this. Can you\n>> re-write the commit message to be more clear about what you are\n>> fixing. Is this multiple unstaged files in the staging box? If so I\n>> don't see what path display is changing.\n>\n>Sorry, for this bad description. I will give you a recipe here what to\n>do to expose the problem. I try later to form this into a new commit\n>message:\n>\n>You have 2 modified, not staged files A and B. Your current view shows\n>the diff for A. Adding B to the selection via Ctrl+Button1 and than\n>perform the \"Stage To Commit\" action from the \"Commit\" menu results\n>only in the staging of B.\n>\n>Note, using Shift+Button1 (i.e. 'adding a range of files to the\n>selection') results in the staging of both files A and B.\n>\n>Bert\n\nAh ok - that explains things and I can see the issue now. I think\nsomething like:\n\n\"When staging a selection of files using Shift-Click to choose a range\nof files then using Ctrl-T or the Stage To Commit menu item will stage\nall the selected files. However if a non-sequential range is selected\nusing Ctrl-Click then only the last name selected gets staged. This\ncommit fixes this to properly stage all selected files by explicitly\nadding the path to the list before showing the diff.\"\n\nwill do.\n\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"},{"id":"177926","messageId":"CAKPyHN0NUyd2E0UuJGpWoFNQw8h4kUkqP5Lcz0ywKjFNEgXsqw@mail.gmail.com","threadId":"28673","inReplyTo":"877h43l0f3.fsf@fox.patthoyts.tk","subject":"Re: [PATCH] git-gui: fix multi selected file operation","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2011-10-18T06:31:39Z","receivedAt":"2011-10-18T06:31:39Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"On Tue, Oct 18, 2011 at 00:26, Pat Thoyts\n<patthoyts@users.sourceforge.net> wrote:\n> Bert Wesarg <bert.wesarg@googlemail.com> writes:\n>\n>>Hi,\n>>\n>>On Sun, Oct 16, 2011 at 00:48, Pat Thoyts\n>><patthoyts@users.sourceforge.net> wrote:\n>>> Bert Wesarg <bert.wesarg@googlemail.com> writes:\n>>>\n>>>>The current path for what we see the diff is not in the list of selected\n>>>>paths. But when we add single paths (with Ctrl) to the set the current path\n>>>>would not be used when the action is performed.\n>>>>\n>>>>Fix this by explicitly putting the path into the list before we start\n>>>>showing the diff.\n>>>>\n>>>>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n>>>>---\n>>>> git-gui.sh |    1 +\n>>>> 1 files changed, 1 insertions(+), 0 deletions(-)\n>>>>\n>>>>diff --git a/git-gui.sh b/git-gui.sh\n>>>>index f897160..e5dd8bc 100755\n>>>>--- a/git-gui.sh\n>>>>+++ b/git-gui.sh\n>>>>@@ -2474,6 +2474,7 @@ proc toggle_or_diff {w x y} {\n>>>>                               [concat $after [list ui_ready]]\n>>>>               }\n>>>>       } else {\n>>>>+              set selected_paths($path) 1\n>>>>               show_diff $path $w $lno\n>>>>       }\n>>>> }\n>>>\n>>> It is not clear what I should be looking for to test this. Can you\n>>> re-write the commit message to be more clear about what you are\n>>> fixing. Is this multiple unstaged files in the staging box? If so I\n>>> don't see what path display is changing.\n>>\n>>Sorry, for this bad description. I will give you a recipe here what to\n>>do to expose the problem. I try later to form this into a new commit\n>>message:\n>>\n>>You have 2 modified, not staged files A and B. Your current view shows\n>>the diff for A. Adding B to the selection via Ctrl+Button1 and than\n>>perform the \"Stage To Commit\" action from the \"Commit\" menu results\n>>only in the staging of B.\n>>\n>>Note, using Shift+Button1 (i.e. 'adding a range of files to the\n>>selection') results in the staging of both files A and B.\n>>\n>>Bert\n>\n> Ah ok - that explains things and I can see the issue now. I think\n> something like:\n>\n> \"When staging a selection of files using Shift-Click to choose a range\n> of files then using Ctrl-T or the Stage To Commit menu item will stage\n> all the selected files. However if a non-sequential range is selected\n> using Ctrl-Click then only the last name selected gets staged. This\n> commit fixes this to properly stage all selected files by explicitly\n> adding the path to the list before showing the diff.\"\n\nThanks for this. A slight, but important, change to the second last sentence:\n\n\"...using Ctrl-Click then all but the first name selected gets staged.\"\n\nIts the first which does not get staged. Ie. that one, which was\nselected just by a Click to view the diff.\n\nBert\n\n>\n> will do.\n>\n> --\n> Pat Thoyts                            http://www.patthoyts.tk/\n> PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n>\n"},{"id":"177938","messageId":"87mxcyn2d9.fsf@fox.patthoyts.tk","threadId":"28673","inReplyTo":"CAKPyHN0NUyd2E0UuJGpWoFNQw8h4kUkqP5Lcz0ywKjFNEgXsqw@mail.gmail.com","subject":"Re: [PATCH] git-gui: fix multi selected file operation","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-10-18T08:13:54Z","receivedAt":"2011-10-18T08:13:54Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Bert Wesarg <bert.wesarg@googlemail.com> writes:\n\n>On Tue, Oct 18, 2011 at 00:26, Pat Thoyts\n><patthoyts@users.sourceforge.net> wrote:\n>> Bert Wesarg <bert.wesarg@googlemail.com> writes:\n>>\n>>>Hi,\n>>>\n>>>On Sun, Oct 16, 2011 at 00:48, Pat Thoyts\n>>><patthoyts@users.sourceforge.net> wrote:\n>>>> Bert Wesarg <bert.wesarg@googlemail.com> writes:\n>>>>\n>>>>>The current path for what we see the diff is not in the list of selected\n>>>>>paths. But when we add single paths (with Ctrl) to the set the current path\n>>>>>would not be used when the action is performed.\n>>>>>\n>>>>>Fix this by explicitly putting the path into the list before we start\n>>>>>showing the diff.\n>>>>>\n>>>>>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n>>>>>---\n>>>>> git-gui.sh |    1 +\n>>>>> 1 files changed, 1 insertions(+), 0 deletions(-)\n>>>>>\n>>>>>diff --git a/git-gui.sh b/git-gui.sh\n>>>>>index f897160..e5dd8bc 100755\n>>>>>--- a/git-gui.sh\n>>>>>+++ b/git-gui.sh\n>>>>>@@ -2474,6 +2474,7 @@ proc toggle_or_diff {w x y} {\n>>>>>                               [concat $after [list ui_ready]]\n>>>>>               }\n>>>>>       } else {\n>>>>>+              set selected_paths($path) 1\n>>>>>               show_diff $path $w $lno\n>>>>>       }\n>>>>> }\n>>>>\n>>>> It is not clear what I should be looking for to test this. Can you\n>>>> re-write the commit message to be more clear about what you are\n>>>> fixing. Is this multiple unstaged files in the staging box? If so I\n>>>> don't see what path display is changing.\n>>>\n>>>Sorry, for this bad description. I will give you a recipe here what to\n>>>do to expose the problem. I try later to form this into a new commit\n>>>message:\n>>>\n>>>You have 2 modified, not staged files A and B. Your current view shows\n>>>the diff for A. Adding B to the selection via Ctrl+Button1 and than\n>>>perform the \"Stage To Commit\" action from the \"Commit\" menu results\n>>>only in the staging of B.\n>>>\n>>>Note, using Shift+Button1 (i.e. 'adding a range of files to the\n>>>selection') results in the staging of both files A and B.\n>>>\n>>>Bert\n>>\n>> Ah ok - that explains things and I can see the issue now. I think\n>> something like:\n>>\n>> \"When staging a selection of files using Shift-Click to choose a range\n>> of files then using Ctrl-T or the Stage To Commit menu item will stage\n>> all the selected files. However if a non-sequential range is selected\n>> using Ctrl-Click then only the last name selected gets staged. This\n>> commit fixes this to properly stage all selected files by explicitly\n>> adding the path to the list before showing the diff.\"\n>\n>Thanks for this. A slight, but important, change to the second last sentence:\n>\n>\"...using Ctrl-Click then all but the first name selected gets staged.\"\n>\n>Its the first which does not get staged. Ie. that one, which was\n>selected just by a Click to view the diff.\n>\n>Bert\n>\n\nThanks - applied with this change to the message.\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"}]}