* [PATCH] git-mergetool: Allow gvimdiff to be used as a mergetool
@ 2007-06-06 1:38 Dan McGee
2007-06-06 2:45 ` Theodore Tso
0 siblings, 1 reply; 3+ messages in thread
From: Dan McGee @ 2007-06-06 1:38 UTC (permalink / raw)
To: git; +Cc: Dan McGee
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
---
Documentation/config.txt | 2 +-
Documentation/git-mergetool.txt | 2 +-
git-mergetool.sh | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 5868d58..3ca01af 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -531,7 +531,7 @@ merge.summary::
merge.tool::
Controls which merge resolution program is used by
gitlink:git-mergetool[l]. Valid values are: "kdiff3", "tkdiff",
- "meld", "xxdiff", "emerge", "vimdiff", and "opendiff"
+ "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", and "opendiff".
merge.verbosity::
Controls the amount of output shown by the recursive merge
diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt
index add01e8..34c4c1c 100644
--- a/Documentation/git-mergetool.txt
+++ b/Documentation/git-mergetool.txt
@@ -25,7 +25,7 @@ OPTIONS
-t or --tool=<tool>::
Use the merge resolution program specified by <tool>.
Valid merge tools are:
- kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, and opendiff
+ kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, and opendiff
+
If a merge resolution program is not specified, 'git mergetool'
will use the configuration variable merge.tool. If the
diff --git a/git-mergetool.sh b/git-mergetool.sh
index e62351b..1e4807b 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -209,7 +209,7 @@ merge_file () {
status=$?
save_backup
;;
- meld|vimdiff)
+ meld|vimdiff|gvimdiff)
touch "$BACKUP"
$merge_tool -- "$LOCAL" "$path" "$REMOTE"
check_unchanged
@@ -293,7 +293,7 @@ done
if test -z "$merge_tool"; then
merge_tool=`git-config merge.tool`
case "$merge_tool" in
- kdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | "")
+ kdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | gvimdiff | "")
;; # happy
*)
echo >&2 "git config option merge.tool set to unknown tool: $merge_tool"
@@ -325,7 +325,7 @@ if test -z "$merge_tool" ; then
fi
case "$merge_tool" in
- kdiff3|tkdiff|meld|xxdiff|vimdiff|opendiff)
+ kdiff3|tkdiff|meld|xxdiff|vimdiff|gvimdiff|opendiff)
if ! type "$merge_tool" > /dev/null 2>&1; then
echo "The merge tool $merge_tool is not available"
exit 1
--
1.5.2.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] git-mergetool: Allow gvimdiff to be used as a mergetool
2007-06-06 1:38 [PATCH] git-mergetool: Allow gvimdiff to be used as a mergetool Dan McGee
@ 2007-06-06 2:45 ` Theodore Tso
2007-06-09 17:17 ` Dan McGee
0 siblings, 1 reply; 3+ messages in thread
From: Theodore Tso @ 2007-06-06 2:45 UTC (permalink / raw)
To: Dan McGee; +Cc: git
Dan, your patch didn't add a gvimdiff check to the code which
determins which merge tool to use if one isn't specified in the config
file:
if test -z "$merge_tool" ; then
if type kdiff3 >/dev/null 2>&1 && test -n "$DISPLAY"; then
merge_tool="kdiff3";
elif type tkdiff >/dev/null 2>&1 && test -n "$DISPLAY"; then
merge_tool=tkdiff
elif type xxdiff >/dev/null 2>&1 && test -n "$DISPLAY"; then
merge_tool=xxdiff
elif type meld >/dev/null 2>&1 && test -n "$DISPLAY"; then
merge_tool=meld
elif type opendiff >/dev/null 2>&1; then
merge_tool=opendiff
...
Was this interntional?
Regards,
- Ted
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] git-mergetool: Allow gvimdiff to be used as a mergetool
2007-06-06 2:45 ` Theodore Tso
@ 2007-06-09 17:17 ` Dan McGee
0 siblings, 0 replies; 3+ messages in thread
From: Dan McGee @ 2007-06-09 17:17 UTC (permalink / raw)
To: Theodore Tso; +Cc: git
On 6/5/07, Theodore Tso <tytso@mit.edu> wrote:
> Dan, your patch didn't add a gvimdiff check to the code which
> determins which merge tool to use if one isn't specified in the config
> file:
Here is an updated patch with that fix, and another that I just
discovered. gvim by default forks and does not run in the foreground,
so we need to call it with the '-f' flag to prevent this.
-Dan
>From b9c8873d63365c55b75bb2ec3d76c208f327b620 Mon Sep 17 00:00:00 2001
From: Dan McGee <dpmcgee@gmail.com>
Date: Tue, 5 Jun 2007 21:19:47 -0400
Subject: [PATCH] git-mergetool: Allow gvimdiff to be used as a mergetool
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
---
Documentation/config.txt | 2 +-
Documentation/git-mergetool.txt | 2 +-
git-mergetool.sh | 12 ++++++++++--
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 5868d58..3ca01af 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -531,7 +531,7 @@ merge.summary::
merge.tool::
Controls which merge resolution program is used by
gitlink:git-mergetool[l]. Valid values are: "kdiff3", "tkdiff",
- "meld", "xxdiff", "emerge", "vimdiff", and "opendiff"
+ "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", and "opendiff".
merge.verbosity::
Controls the amount of output shown by the recursive merge
diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt
index add01e8..34c4c1c 100644
--- a/Documentation/git-mergetool.txt
+++ b/Documentation/git-mergetool.txt
@@ -25,7 +25,7 @@ OPTIONS
-t or --tool=<tool>::
Use the merge resolution program specified by <tool>.
Valid merge tools are:
- kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, and opendiff
+ kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, and opendiff
+
If a merge resolution program is not specified, 'git mergetool'
will use the configuration variable merge.tool. If the
diff --git a/git-mergetool.sh b/git-mergetool.sh
index bb21b03..c9a90cd 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -215,6 +215,12 @@ merge_file () {
check_unchanged
save_backup
;;
+ gvimdiff)
+ touch "$BACKUP"
+ gvimdiff -f -- "$LOCAL" "$path" "$REMOTE"
+ check_unchanged
+ save_backup
+ ;;
xxdiff)
touch "$BACKUP"
if base_present ; then
@@ -293,7 +299,7 @@ done
if test -z "$merge_tool"; then
merge_tool=`git-config merge.tool`
case "$merge_tool" in
- kdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | "")
+ kdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | gvimdiff | "")
;; # happy
*)
echo >&2 "git config option merge.tool set to unknown tool: $merge_tool"
@@ -312,6 +318,8 @@ if test -z "$merge_tool" ; then
merge_tool=xxdiff
elif type meld >/dev/null 2>&1 && test -n "$DISPLAY"; then
merge_tool=meld
+ elif type gvimdiff >/dev/null 2>&1 && test -n "$DISPLAY"; then
+ merge_tool=gvimdiff
elif type opendiff >/dev/null 2>&1; then
merge_tool=opendiff
elif type emacs >/dev/null 2>&1; then
@@ -325,7 +333,7 @@ if test -z "$merge_tool" ; then
fi
case "$merge_tool" in
- kdiff3|tkdiff|meld|xxdiff|vimdiff|opendiff)
+ kdiff3|tkdiff|meld|xxdiff|vimdiff|gvimdiff|opendiff)
if ! type "$merge_tool" > /dev/null 2>&1; then
echo "The merge tool $merge_tool is not available"
exit 1
--
1.5.2.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-06-09 17:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-06 1:38 [PATCH] git-mergetool: Allow gvimdiff to be used as a mergetool Dan McGee
2007-06-06 2:45 ` Theodore Tso
2007-06-09 17:17 ` Dan McGee
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).