git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-gui: fix multi selected file operation
@ 2011-10-14  8:19 Bert Wesarg
  2011-10-15 22:48 ` Pat Thoyts
  0 siblings, 1 reply; 6+ messages in thread
From: Bert Wesarg @ 2011-10-14  8:19 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: git, Bert Wesarg

The current path for what we see the diff is not in the list of selected
paths. But when we add single paths (with Ctrl) to the set the current path
would not be used when the action is performed.

Fix this by explicitly putting the path into the list before we start
showing the diff.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 git-gui.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/git-gui.sh b/git-gui.sh
index f897160..e5dd8bc 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -2474,6 +2474,7 @@ proc toggle_or_diff {w x y} {
 				[concat $after [list ui_ready]]
 		}
 	} else {
+		set selected_paths($path) 1
 		show_diff $path $w $lno
 	}
 }
-- 
1.7.6.789.gb4599

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

* Re: [PATCH] git-gui: fix multi selected file operation
  2011-10-14  8:19 [PATCH] git-gui: fix multi selected file operation Bert Wesarg
@ 2011-10-15 22:48 ` Pat Thoyts
  2011-10-17  5:54   ` Bert Wesarg
  0 siblings, 1 reply; 6+ messages in thread
From: Pat Thoyts @ 2011-10-15 22:48 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: git

Bert Wesarg <bert.wesarg@googlemail.com> writes:

>The current path for what we see the diff is not in the list of selected
>paths. But when we add single paths (with Ctrl) to the set the current path
>would not be used when the action is performed.
>
>Fix this by explicitly putting the path into the list before we start
>showing the diff.
>
>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>---
> git-gui.sh |    1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
>diff --git a/git-gui.sh b/git-gui.sh
>index f897160..e5dd8bc 100755
>--- a/git-gui.sh
>+++ b/git-gui.sh
>@@ -2474,6 +2474,7 @@ proc toggle_or_diff {w x y} {
> 				[concat $after [list ui_ready]]
> 		}
> 	} else {
>+		set selected_paths($path) 1
> 		show_diff $path $w $lno
> 	}
> }

It is not clear what I should be looking for to test this. Can you
re-write the commit message to be more clear about what you are
fixing. Is this multiple unstaged files in the staging box? If so I
don't see what path display is changing.

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

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

* Re: [PATCH] git-gui: fix multi selected file operation
  2011-10-15 22:48 ` Pat Thoyts
@ 2011-10-17  5:54   ` Bert Wesarg
  2011-10-17 22:26     ` Pat Thoyts
  0 siblings, 1 reply; 6+ messages in thread
From: Bert Wesarg @ 2011-10-17  5:54 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: git

Hi,

On Sun, Oct 16, 2011 at 00:48, Pat Thoyts
<patthoyts@users.sourceforge.net> wrote:
> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>
>>The current path for what we see the diff is not in the list of selected
>>paths. But when we add single paths (with Ctrl) to the set the current path
>>would not be used when the action is performed.
>>
>>Fix this by explicitly putting the path into the list before we start
>>showing the diff.
>>
>>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>>---
>> git-gui.sh |    1 +
>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>
>>diff --git a/git-gui.sh b/git-gui.sh
>>index f897160..e5dd8bc 100755
>>--- a/git-gui.sh
>>+++ b/git-gui.sh
>>@@ -2474,6 +2474,7 @@ proc toggle_or_diff {w x y} {
>>                               [concat $after [list ui_ready]]
>>               }
>>       } else {
>>+              set selected_paths($path) 1
>>               show_diff $path $w $lno
>>       }
>> }
>
> It is not clear what I should be looking for to test this. Can you
> re-write the commit message to be more clear about what you are
> fixing. Is this multiple unstaged files in the staging box? If so I
> don't see what path display is changing.

Sorry, for this bad description. I will give you a recipe here what to
do to expose the problem. I try later to form this into a new commit
message:

You have 2 modified, not staged files A and B. Your current view shows
the diff for A. Adding B to the selection via Ctrl+Button1 and than
perform the "Stage To Commit" action from the "Commit" menu results
only in the staging of B.

Note, using Shift+Button1 (i.e. 'adding a range of files to the
selection') results in the staging of both files A and B.

Bert

>
> --
> Pat Thoyts                            http://www.patthoyts.tk/
> PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD
>

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

* Re: [PATCH] git-gui: fix multi selected file operation
  2011-10-17  5:54   ` Bert Wesarg
@ 2011-10-17 22:26     ` Pat Thoyts
  2011-10-18  6:31       ` Bert Wesarg
  0 siblings, 1 reply; 6+ messages in thread
From: Pat Thoyts @ 2011-10-17 22:26 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: git

Bert Wesarg <bert.wesarg@googlemail.com> writes:

>Hi,
>
>On Sun, Oct 16, 2011 at 00:48, Pat Thoyts
><patthoyts@users.sourceforge.net> wrote:
>> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>>
>>>The current path for what we see the diff is not in the list of selected
>>>paths. But when we add single paths (with Ctrl) to the set the current path
>>>would not be used when the action is performed.
>>>
>>>Fix this by explicitly putting the path into the list before we start
>>>showing the diff.
>>>
>>>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>>>---
>>> git-gui.sh |    1 +
>>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>>
>>>diff --git a/git-gui.sh b/git-gui.sh
>>>index f897160..e5dd8bc 100755
>>>--- a/git-gui.sh
>>>+++ b/git-gui.sh
>>>@@ -2474,6 +2474,7 @@ proc toggle_or_diff {w x y} {
>>>                               [concat $after [list ui_ready]]
>>>               }
>>>       } else {
>>>+              set selected_paths($path) 1
>>>               show_diff $path $w $lno
>>>       }
>>> }
>>
>> It is not clear what I should be looking for to test this. Can you
>> re-write the commit message to be more clear about what you are
>> fixing. Is this multiple unstaged files in the staging box? If so I
>> don't see what path display is changing.
>
>Sorry, for this bad description. I will give you a recipe here what to
>do to expose the problem. I try later to form this into a new commit
>message:
>
>You have 2 modified, not staged files A and B. Your current view shows
>the diff for A. Adding B to the selection via Ctrl+Button1 and than
>perform the "Stage To Commit" action from the "Commit" menu results
>only in the staging of B.
>
>Note, using Shift+Button1 (i.e. 'adding a range of files to the
>selection') results in the staging of both files A and B.
>
>Bert

Ah ok - that explains things and I can see the issue now. I think
something like:

"When staging a selection of files using Shift-Click to choose a range
of files then using Ctrl-T or the Stage To Commit menu item will stage
all the selected files. However if a non-sequential range is selected
using Ctrl-Click then only the last name selected gets staged. This
commit fixes this to properly stage all selected files by explicitly
adding the path to the list before showing the diff."

will do.

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

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

* Re: [PATCH] git-gui: fix multi selected file operation
  2011-10-17 22:26     ` Pat Thoyts
@ 2011-10-18  6:31       ` Bert Wesarg
  2011-10-18  8:13         ` Pat Thoyts
  0 siblings, 1 reply; 6+ messages in thread
From: Bert Wesarg @ 2011-10-18  6:31 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: git

On Tue, Oct 18, 2011 at 00:26, Pat Thoyts
<patthoyts@users.sourceforge.net> wrote:
> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>
>>Hi,
>>
>>On Sun, Oct 16, 2011 at 00:48, Pat Thoyts
>><patthoyts@users.sourceforge.net> wrote:
>>> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>>>
>>>>The current path for what we see the diff is not in the list of selected
>>>>paths. But when we add single paths (with Ctrl) to the set the current path
>>>>would not be used when the action is performed.
>>>>
>>>>Fix this by explicitly putting the path into the list before we start
>>>>showing the diff.
>>>>
>>>>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>>>>---
>>>> git-gui.sh |    1 +
>>>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>>>
>>>>diff --git a/git-gui.sh b/git-gui.sh
>>>>index f897160..e5dd8bc 100755
>>>>--- a/git-gui.sh
>>>>+++ b/git-gui.sh
>>>>@@ -2474,6 +2474,7 @@ proc toggle_or_diff {w x y} {
>>>>                               [concat $after [list ui_ready]]
>>>>               }
>>>>       } else {
>>>>+              set selected_paths($path) 1
>>>>               show_diff $path $w $lno
>>>>       }
>>>> }
>>>
>>> It is not clear what I should be looking for to test this. Can you
>>> re-write the commit message to be more clear about what you are
>>> fixing. Is this multiple unstaged files in the staging box? If so I
>>> don't see what path display is changing.
>>
>>Sorry, for this bad description. I will give you a recipe here what to
>>do to expose the problem. I try later to form this into a new commit
>>message:
>>
>>You have 2 modified, not staged files A and B. Your current view shows
>>the diff for A. Adding B to the selection via Ctrl+Button1 and than
>>perform the "Stage To Commit" action from the "Commit" menu results
>>only in the staging of B.
>>
>>Note, using Shift+Button1 (i.e. 'adding a range of files to the
>>selection') results in the staging of both files A and B.
>>
>>Bert
>
> Ah ok - that explains things and I can see the issue now. I think
> something like:
>
> "When staging a selection of files using Shift-Click to choose a range
> of files then using Ctrl-T or the Stage To Commit menu item will stage
> all the selected files. However if a non-sequential range is selected
> using Ctrl-Click then only the last name selected gets staged. This
> commit fixes this to properly stage all selected files by explicitly
> adding the path to the list before showing the diff."

Thanks for this. A slight, but important, change to the second last sentence:

"...using Ctrl-Click then all but the first name selected gets staged."

Its the first which does not get staged. Ie. that one, which was
selected just by a Click to view the diff.

Bert

>
> will do.
>
> --
> Pat Thoyts                            http://www.patthoyts.tk/
> PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD
>

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

* Re: [PATCH] git-gui: fix multi selected file operation
  2011-10-18  6:31       ` Bert Wesarg
@ 2011-10-18  8:13         ` Pat Thoyts
  0 siblings, 0 replies; 6+ messages in thread
From: Pat Thoyts @ 2011-10-18  8:13 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: git

Bert Wesarg <bert.wesarg@googlemail.com> writes:

>On Tue, Oct 18, 2011 at 00:26, Pat Thoyts
><patthoyts@users.sourceforge.net> wrote:
>> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>>
>>>Hi,
>>>
>>>On Sun, Oct 16, 2011 at 00:48, Pat Thoyts
>>><patthoyts@users.sourceforge.net> wrote:
>>>> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>>>>
>>>>>The current path for what we see the diff is not in the list of selected
>>>>>paths. But when we add single paths (with Ctrl) to the set the current path
>>>>>would not be used when the action is performed.
>>>>>
>>>>>Fix this by explicitly putting the path into the list before we start
>>>>>showing the diff.
>>>>>
>>>>>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>>>>>---
>>>>> git-gui.sh |    1 +
>>>>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>>>>
>>>>>diff --git a/git-gui.sh b/git-gui.sh
>>>>>index f897160..e5dd8bc 100755
>>>>>--- a/git-gui.sh
>>>>>+++ b/git-gui.sh
>>>>>@@ -2474,6 +2474,7 @@ proc toggle_or_diff {w x y} {
>>>>>                               [concat $after [list ui_ready]]
>>>>>               }
>>>>>       } else {
>>>>>+              set selected_paths($path) 1
>>>>>               show_diff $path $w $lno
>>>>>       }
>>>>> }
>>>>
>>>> It is not clear what I should be looking for to test this. Can you
>>>> re-write the commit message to be more clear about what you are
>>>> fixing. Is this multiple unstaged files in the staging box? If so I
>>>> don't see what path display is changing.
>>>
>>>Sorry, for this bad description. I will give you a recipe here what to
>>>do to expose the problem. I try later to form this into a new commit
>>>message:
>>>
>>>You have 2 modified, not staged files A and B. Your current view shows
>>>the diff for A. Adding B to the selection via Ctrl+Button1 and than
>>>perform the "Stage To Commit" action from the "Commit" menu results
>>>only in the staging of B.
>>>
>>>Note, using Shift+Button1 (i.e. 'adding a range of files to the
>>>selection') results in the staging of both files A and B.
>>>
>>>Bert
>>
>> Ah ok - that explains things and I can see the issue now. I think
>> something like:
>>
>> "When staging a selection of files using Shift-Click to choose a range
>> of files then using Ctrl-T or the Stage To Commit menu item will stage
>> all the selected files. However if a non-sequential range is selected
>> using Ctrl-Click then only the last name selected gets staged. This
>> commit fixes this to properly stage all selected files by explicitly
>> adding the path to the list before showing the diff."
>
>Thanks for this. A slight, but important, change to the second last sentence:
>
>"...using Ctrl-Click then all but the first name selected gets staged."
>
>Its the first which does not get staged. Ie. that one, which was
>selected just by a Click to view the diff.
>
>Bert
>

Thanks - applied with this change to the message.
-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

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

end of thread, other threads:[~2011-10-18  8:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-14  8:19 [PATCH] git-gui: fix multi selected file operation Bert Wesarg
2011-10-15 22:48 ` Pat Thoyts
2011-10-17  5:54   ` Bert Wesarg
2011-10-17 22:26     ` Pat Thoyts
2011-10-18  6:31       ` Bert Wesarg
2011-10-18  8:13         ` Pat Thoyts

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 NNTP newsgroup(s).