git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] mergetool--lib: fix startup options for gvimdiff tool
@ 2013-01-24  7:16 Alexey Shumkin
  2013-01-24  7:16 ` [PATCH 2/3] mergetool--lib: Add diffuse as a tool Alexey Shumkin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Alexey Shumkin @ 2013-01-24  7:16 UTC (permalink / raw)
  To: git; +Cc: Pat Thoyts, Alexey Shumkin, Junio C Hamano

Options are taken from <Git source>/mergetools/vim

Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
---
 git-gui/lib/mergetool.tcl | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/git-gui/lib/mergetool.tcl b/git-gui/lib/mergetool.tcl
index 3c8e73b..4fc1cab 100644
--- a/git-gui/lib/mergetool.tcl
+++ b/git-gui/lib/mergetool.tcl
@@ -211,7 +211,13 @@ proc merge_resolve_tool2 {} {
 		}
 	}
 	gvimdiff {
-		set cmdline [list "$merge_tool_path" -f "$LOCAL" "$MERGED" "$REMOTE"]
+		if {$base_stage ne {}} {
+			set cmdline [list "$merge_tool_path" -f -d -c "wincmd J" \
+				"$MERGED" "$LOCAL" "$BASE" "$REMOTE"]
+		} else {
+			set cmdline [list "$merge_tool_path" -f -d -c "wincmd l" \
+				"$LOCAL" "$MERGED" "$REMOTE"]
+		}
 	}
 	kdiff3 {
 		if {$base_stage ne {}} {
-- 
1.8.1.1.10.g9255f3f

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

* [PATCH 2/3] mergetool--lib: Add diffuse as a tool
  2013-01-24  7:16 [PATCH 1/3] mergetool--lib: fix startup options for gvimdiff tool Alexey Shumkin
@ 2013-01-24  7:16 ` Alexey Shumkin
  2013-01-24  7:16 ` [PATCH 3/3] mergetool--lib: Add TortoiseMerge " Alexey Shumkin
  2013-01-25  5:07 ` [PATCH 1/3] mergetool--lib: fix startup options for gvimdiff tool David Aguilar
  2 siblings, 0 replies; 5+ messages in thread
From: Alexey Shumkin @ 2013-01-24  7:16 UTC (permalink / raw)
  To: git; +Cc: Pat Thoyts, Alexey Shumkin, Junio C Hamano

Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
---
 git-gui/lib/mergetool.tcl | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/git-gui/lib/mergetool.tcl b/git-gui/lib/mergetool.tcl
index 4fc1cab..837ce17 100644
--- a/git-gui/lib/mergetool.tcl
+++ b/git-gui/lib/mergetool.tcl
@@ -194,6 +194,15 @@ proc merge_resolve_tool2 {} {
 			set cmdline [list "$merge_tool_path" "$LOCAL" "$REMOTE" -mergeoutput="$MERGED"]
 		}
 	}
+	diffuse {
+		if {$base_stage ne {}} {
+			set cmdline [list "$merge_tool_path" \
+				"$LOCAL" "$MERGED" "$REMOTE" "$BASE"]
+		} else {
+			set cmdline [list "$merge_tool_path" \
+				"$LOCAL" "$MERGED" "$REMOTE"]
+		}
+	}
 	ecmerge {
 		if {$base_stage ne {}} {
 			set cmdline [list "$merge_tool_path" "$BASE" "$LOCAL" "$REMOTE" --default --mode=merge3 --to="$MERGED"]
-- 
1.8.1.1.10.g9255f3f

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

* [PATCH 3/3] mergetool--lib: Add TortoiseMerge as a tool
  2013-01-24  7:16 [PATCH 1/3] mergetool--lib: fix startup options for gvimdiff tool Alexey Shumkin
  2013-01-24  7:16 ` [PATCH 2/3] mergetool--lib: Add diffuse as a tool Alexey Shumkin
@ 2013-01-24  7:16 ` Alexey Shumkin
  2013-01-25  5:07 ` [PATCH 1/3] mergetool--lib: fix startup options for gvimdiff tool David Aguilar
  2 siblings, 0 replies; 5+ messages in thread
From: Alexey Shumkin @ 2013-01-24  7:16 UTC (permalink / raw)
  To: git; +Cc: Pat Thoyts, Alexey Shumkin, Junio C Hamano

Also added Russian translation of the added error message
"%s cannot be used without a base"

Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
---
 git-gui/lib/mergetool.tcl | 10 ++++++++++
 git-gui/po/ru.po          |  4 ++++
 2 files changed, 14 insertions(+)

diff --git a/git-gui/lib/mergetool.tcl b/git-gui/lib/mergetool.tcl
index 837ce17..d978770 100644
--- a/git-gui/lib/mergetool.tcl
+++ b/git-gui/lib/mergetool.tcl
@@ -257,6 +257,16 @@ proc merge_resolve_tool2 {} {
 			set cmdline [list "$merge_tool_path" -o "$MERGED" "$LOCAL" "$REMOTE"]
 		}
 	}
+	tortoisemerge {
+		if {$base_stage ne {}} {
+			set cmdline [list "$merge_tool_path" \
+				-base:$BASE -mine:$LOCAL \
+				-theirs:$REMOTE -merged:$MERGED]
+		} else {
+			error_popup [mc "%s cannot be used without a base" "TortoiseMerge"]
+			return
+		}
+	}
 	vimdiff {
 		error_popup [mc "Not a GUI merge tool: '%s'" $tool]
 		return
diff --git a/git-gui/po/ru.po b/git-gui/po/ru.po
index ca4343b..e9ef810 100644
--- a/git-gui/po/ru.po
+++ b/git-gui/po/ru.po
@@ -1948,6 +1948,10 @@ msgstr "Конфликтующий файл не существует"
 msgid "Not a GUI merge tool: '%s'"
 msgstr "'%s' не является программой слияния"
 
+#: lib/mergetool.tcl:280
+msgid "%s cannot be used without a base"
+msgstr "%s не может использоваться без базовой версии"
+
 #: lib/mergetool.tcl:268
 #, tcl-format
 msgid "Unsupported merge tool '%s'"
-- 
1.8.1.1.10.g9255f3f

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

* Re: [PATCH 1/3] mergetool--lib: fix startup options for gvimdiff tool
  2013-01-24  7:16 [PATCH 1/3] mergetool--lib: fix startup options for gvimdiff tool Alexey Shumkin
  2013-01-24  7:16 ` [PATCH 2/3] mergetool--lib: Add diffuse as a tool Alexey Shumkin
  2013-01-24  7:16 ` [PATCH 3/3] mergetool--lib: Add TortoiseMerge " Alexey Shumkin
@ 2013-01-25  5:07 ` David Aguilar
  2013-01-25  8:44   ` Alexey Shumkin
  2 siblings, 1 reply; 5+ messages in thread
From: David Aguilar @ 2013-01-25  5:07 UTC (permalink / raw)
  To: Alexey Shumkin; +Cc: git, Pat Thoyts, Junio C Hamano

On Wed, Jan 23, 2013 at 11:16 PM, Alexey Shumkin <alex.crezoff@gmail.com> wrote:
> Options are taken from <Git source>/mergetools/vim
>
> Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
> ---
>  git-gui/lib/mergetool.tcl | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)

A better long-term solution might be to teach git gui to use "git difftool".

Would it be better to teach git-gui (and gitk) about mergetool/difftool?
That would allow us to possibly eliminate this duplication.

We did start towards that path when difftool learned the --extcmd
option (for use by gitk) but I have not followed through.

What do you think about trying that approach?


> diff --git a/git-gui/lib/mergetool.tcl b/git-gui/lib/mergetool.tcl
> index 3c8e73b..4fc1cab 100644
> --- a/git-gui/lib/mergetool.tcl
> +++ b/git-gui/lib/mergetool.tcl
> @@ -211,7 +211,13 @@ proc merge_resolve_tool2 {} {
>                 }
>         }
>         gvimdiff {
> -               set cmdline [list "$merge_tool_path" -f "$LOCAL" "$MERGED" "$REMOTE"]
> +               if {$base_stage ne {}} {
> +                       set cmdline [list "$merge_tool_path" -f -d -c "wincmd J" \
> +                               "$MERGED" "$LOCAL" "$BASE" "$REMOTE"]
> +               } else {
> +                       set cmdline [list "$merge_tool_path" -f -d -c "wincmd l" \
> +                               "$LOCAL" "$MERGED" "$REMOTE"]
> +               }
>         }
>         kdiff3 {
>                 if {$base_stage ne {}} {
> --
> 1.8.1.1.10.g9255f3f
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
David

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

* Re: [PATCH 1/3] mergetool--lib: fix startup options for gvimdiff tool
  2013-01-25  5:07 ` [PATCH 1/3] mergetool--lib: fix startup options for gvimdiff tool David Aguilar
@ 2013-01-25  8:44   ` Alexey Shumkin
  0 siblings, 0 replies; 5+ messages in thread
From: Alexey Shumkin @ 2013-01-25  8:44 UTC (permalink / raw)
  To: David Aguilar; +Cc: git, Pat Thoyts, Junio C Hamano

Maybe, some time ;)
Actually, I'm not TCL-programmer. With one of these patches I just have
solved one my problem (to run tortoisemerge with git-gui) when I
was showing to my collegue how to work with Git, and on the side I
fixed another two bugs. So, I decided to sumbit these patches, to avoid
applying them every time after each Git update as I did last 1.5 years
with other patches which still are not submitted, because I'm too lazy
to follow Git development workflow in my free time )

> On Wed, Jan 23, 2013 at 11:16 PM, Alexey Shumkin
> <alex.crezoff@gmail.com> wrote:
> > Options are taken from <Git source>/mergetools/vim
> >
> > Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
> > ---
> >  git-gui/lib/mergetool.tcl | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> A better long-term solution might be to teach git gui to use "git
> difftool".
> 
> Would it be better to teach git-gui (and gitk) about
> mergetool/difftool? That would allow us to possibly eliminate this
> duplication.
> 
> We did start towards that path when difftool learned the --extcmd
> option (for use by gitk) but I have not followed through.
> 
> What do you think about trying that approach?
> 
> 
> > diff --git a/git-gui/lib/mergetool.tcl b/git-gui/lib/mergetool.tcl
> > index 3c8e73b..4fc1cab 100644
> > --- a/git-gui/lib/mergetool.tcl
> > +++ b/git-gui/lib/mergetool.tcl
> > @@ -211,7 +211,13 @@ proc merge_resolve_tool2 {} {
> >                 }
> >         }
> >         gvimdiff {
> > -               set cmdline [list "$merge_tool_path" -f "$LOCAL"
> > "$MERGED" "$REMOTE"]
> > +               if {$base_stage ne {}} {
> > +                       set cmdline [list "$merge_tool_path" -f -d
> > -c "wincmd J" \
> > +                               "$MERGED" "$LOCAL" "$BASE"
> > "$REMOTE"]
> > +               } else {
> > +                       set cmdline [list "$merge_tool_path" -f -d
> > -c "wincmd l" \
> > +                               "$LOCAL" "$MERGED" "$REMOTE"]
> > +               }
> >         }
> >         kdiff3 {
> >                 if {$base_stage ne {}} {
> > --
> > 1.8.1.1.10.g9255f3f
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe git" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 

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

end of thread, other threads:[~2013-01-25  8:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-24  7:16 [PATCH 1/3] mergetool--lib: fix startup options for gvimdiff tool Alexey Shumkin
2013-01-24  7:16 ` [PATCH 2/3] mergetool--lib: Add diffuse as a tool Alexey Shumkin
2013-01-24  7:16 ` [PATCH 3/3] mergetool--lib: Add TortoiseMerge " Alexey Shumkin
2013-01-25  5:07 ` [PATCH 1/3] mergetool--lib: fix startup options for gvimdiff tool David Aguilar
2013-01-25  8:44   ` Alexey Shumkin

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).