# Add new option in the right click menu in git gui

5 messages from 2010-02-18 to 2010-03-26. Participants: Sylvain Rabot, Heiko Voigt, Bert Wesarg.
Thread: https://gitlist.dev/t/22720

## Sylvain Rabot, 2010-02-18 23:11

Subject: Add new option in the right click menu in git gui
Message-ID: <7fce93be1002181511v1c671f82u7f3d7cc6e3512bab@mail.gmail.com>
URL: https://gitlist.dev/e/7fce93be1002181511v1c671f82u7f3d7cc6e3512bab%40mail.gmail.com

```
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, 2010-03-01 17:12

Subject: Re: Add new option in the right click menu in git gui
Message-ID: <20100301171222.GA35830@book.hvoigt.net>
URL: https://gitlist.dev/e/20100301171222.GA35830%40book.hvoigt.net
In-Reply-To: <7fce93be1002181511v1c671f82u7f3d7cc6e3512bab@mail.gmail.com>

```
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

```

## Sylvain Rabot, 2010-03-01 21:29

Subject: Re: Add new option in the right click menu in git gui
Message-ID: <1267478971.4400.5.camel@kheops>
URL: https://gitlist.dev/e/1267478971.4400.5.camel%40kheops
In-Reply-To: <20100301171222.GA35830@book.hvoigt.net>

```
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

Thanks.

-- 
Sylvain Rabot <sylvain@abstraction.fr>

```

## Bert Wesarg, 2010-03-01 21:45

Subject: Re: Add new option in the right click menu in git gui
Message-ID: <36ca99e91003011345n43aad0c5m5c02eaf692d54efd@mail.gmail.com>
URL: https://gitlist.dev/e/36ca99e91003011345n43aad0c5m5c02eaf692d54efd%40mail.gmail.com
In-Reply-To: <1267478971.4400.5.camel@kheops>

```
On Mon, Mar 1, 2010 at 22:29, Sylvain Rabot <sylvain@abstraction.fr> wrote:
> 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, 2010-03-26 13:53

Subject: Re: Re: Add new option in the right click menu in git gui
Message-ID: <20100326135346.GB22339@book.hvoigt.net>
URL: https://gitlist.dev/e/20100326135346.GB22339%40book.hvoigt.net
In-Reply-To: <36ca99e91003011345n43aad0c5m5c02eaf692d54efd@mail.gmail.com>

```
Hi,

this email has been lying in my mailbox for while ...

On Mon, Mar 01, 2010 at 10:45:10PM +0100, Bert Wesarg wrote:
> 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/

```
