threads / discuss / 22720

Add new option in the right click menu in git gui

Subject: Add new option in the right click menu in git gui

## tl;dr

5 messages between Feb 18, 2010 and Mar 26, 2010.

replies: 4people: 3as markdown or json

Sylvain Rabot· Feb 18, 2010, 23:11 UTC · lore
Hi,

In case of conflicts it is possible in git gui, through the right click menu, to use local or remote versions, but, unless I missed something, it is not possible, after using the merge tool, to add merged files to the index.

It would be nice if we could add merged files in the index directly in git gui.

Besides, having this third option will avoid the mistake I used to make when I was a git beginner, knowing, after using the merge tools I was using the "use local version" options thinking it will add to the index the local changes I just made to the conflicted file.

Regards.
-- 
Sylvain
Heiko Voigt· Mar 1, 2010, 17:12 UTC · re: Sylvain Rabot · lore

Re: Add new option in the right click menu in git gui

On Fri, Feb 19, 2010 at 12:11:57AM +0100, Sylvain Rabot wrote:
Show 8 quoted lines
> Hi,
> 
> In case of conflicts it is possible in git gui, through the right
> click menu, to use local or remote versions, but, unless I missed
> something, it is not possible, after using the merge tool, to add
> merged files to the index.
> 
> It would be nice if we could add merged files in the index directly in git gui.

I do not see anything missing. After resolving a conflict you usually just need to add the files (in git gui click on the icon of the file). Am I missing something? This is the usual conflict resolution workflow for git, I see no need for an extra menu option.

cheers Heiko
Sylvain Rabot· Mar 1, 2010, 21:29 UTC · re: Heiko Voigt · lore

Re: Add new option in the right click menu in git gui

On Mon, 2010-03-01 at 18:12 +0100, Heiko Voigt wrote:
Show 16 quoted lines
> On Fri, Feb 19, 2010 at 12:11:57AM +0100, Sylvain Rabot wrote:
> > Hi,
> > 
> > In case of conflicts it is possible in git gui, through the right
> > click menu, to use local or remote versions, but, unless I missed
> > something, it is not possible, after using the merge tool, to add
> > merged files to the index.
> > 
> > It would be nice if we could add merged files in the index directly in git gui.
> 
> I do not see anything missing. After resolving a conflict you usually
> just need to add the files (in git gui click on the icon of the file).
> Am I missing something? This is the usual conflict resolution workflow
> for git, I see no need for an extra menu option.
> 
> cheers Heiko

Haaaaaaa, I don't know how many times I tried to do a right click on the path itself but I never had the idea to click the icon :P

Thanks.
-- 
Sylvain Rabot <sylvain@abstraction.fr>
Bert Wesarg· Mar 1, 2010, 21:45 UTC · re: Sylvain Rabot · lore

Re: Add new option in the right click menu in git gui

On Mon, Mar 1, 2010 at 22:29, Sylvain Rabot <sylvain@abstraction.fr> wrote:
Show 20 quoted lines
> On Mon, 2010-03-01 at 18:12 +0100, Heiko Voigt wrote:
>> On Fri, Feb 19, 2010 at 12:11:57AM +0100, Sylvain Rabot wrote:
>> > Hi,
>> >
>> > In case of conflicts it is possible in git gui, through the right
>> > click menu, to use local or remote versions, but, unless I missed
>> > something, it is not possible, after using the merge tool, to add
>> > merged files to the index.
>> >
>> > It would be nice if we could add merged files in the index directly in git gui.
>>
>> I do not see anything missing. After resolving a conflict you usually
>> just need to add the files (in git gui click on the icon of the file).
>> Am I missing something? This is the usual conflict resolution workflow
>> for git, I see no need for an extra menu option.
>>
>> cheers Heiko
>
> Haaaaaaa, I don't know how many times I tried to do a right click on the
> path itself but I never had the idea to click the icon :P

Actually, I would like to be able to have a right click menu for the path too and have access to the guitool entries in the Tools menu which require a path (ie. needsfile=true). That would reduce by mouse movements drastically.

I have looked into this issue by myself, but I'm not that familiar with tcl/tk.
Bert
Heiko Voigt· Mar 26, 2010, 13:53 UTC · re: Bert Wesarg · lore

Re: Re: Add new option in the right click menu in git gui

Hi,
this email has been lying in my mailbox for while ...
On Mon, Mar 01, 2010 at 10:45:10PM +0100, Bert Wesarg wrote:
Show 6 quoted lines
> Actually, I would like to be able to have a right click menu for the
> path too and have access to the guitool entries in the Tools menu
> which require a path (ie. needsfile=true). That would reduce by mouse
> movements drastically.
> 
> I have looked into this issue by myself, but I'm not that familiar with tcl/tk.

Just try it. The "Tcl Introduction" sample chapter from this book[1] explains the tcl language in 17 pages quite nicely.

I thought of this myself but never had the time to do it. If you are still interested in implementing it take a look at the 'bind' command. It lets you bind procedures to events that occur on widgets or the application. For the diff view this is done in git-gui.sh on around line 3465 with this command:

  bind_button3 $ui_diff [list popup_diff_menu $ctxm $ctxmmg $ctxmsm %x %y %X %Y]

bind_button3 is just a wrapper so bind is platform independent. So you probably want to implement a method similar to popup_diff_menu which popups the right menu for the selected file.

BTW, the widgets for the files are of the same type (text) as $ui_diff and are stored in the variables: $ui_index and $ui_workdir for the index and working directory respectively.

Hope that helps.
cheers Heiko
[1] http://www.beedub.com/book/

← back to recent threads