Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
mergetool--lib: add p4merge as a pre-configured mergetool option
author
Scott Chacon
<schacon@gmail.com>
Wed, 28 Oct 2009 21:39:32 +0000
(14:39 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 28 Oct 2009 23:48:20 +0000
(16:48 -0700)
Add p4merge to the set of built-in diff/merge tools, and update
bash completion and documentation.
Signed-off-by: Scott Chacon <schacon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-difftool.txt
patch
|
blob
|
history
Documentation/git-mergetool.txt
patch
|
blob
|
history
Documentation/merge-config.txt
patch
|
blob
|
history
contrib/completion/git-completion.bash
patch
|
blob
|
history
git-mergetool--lib.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
cd0f8e6
)
diff --git
a/Documentation/git-difftool.txt
b/Documentation/git-difftool.txt
index 96a6c51a4b83207fa23fc8f09cb02f57b1085ea4..8e9aed67d7f68c0234ee47dc147736bf3b8e5c4f 100644
(file)
--- a/
Documentation/git-difftool.txt
+++ b/
Documentation/git-difftool.txt
@@
-31,7
+31,7
@@
OPTIONS
Use the diff tool specified by <tool>.
Valid merge tools are:
kdiff3, kompare, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff,
Use the diff tool specified by <tool>.
Valid merge tools are:
kdiff3, kompare, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff,
- ecmerge, diffuse, opendiff and araxis.
+ ecmerge, diffuse, opendiff
, p4merge
and araxis.
+
If a diff tool is not specified, 'git-difftool'
will use the configuration variable `diff.tool`. If the
+
If a diff tool is not specified, 'git-difftool'
will use the configuration variable `diff.tool`. If the
diff --git
a/Documentation/git-mergetool.txt
b/Documentation/git-mergetool.txt
index 68ed6c095664b8f06635ba7eaa85b85086b24280..4a6f7f3a2d189c40e4abfe4f74178f79d1c563fd 100644
(file)
--- a/
Documentation/git-mergetool.txt
+++ b/
Documentation/git-mergetool.txt
@@
-27,7
+27,7
@@
OPTIONS
Use the merge resolution program specified by <tool>.
Valid merge tools are:
kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge,
Use the merge resolution program specified by <tool>.
Valid merge tools are:
kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge,
- diffuse, tortoisemerge, opendiff and araxis.
+ diffuse, tortoisemerge, opendiff
, p4merge
and araxis.
+
If a merge resolution program is not specified, 'git-mergetool'
will use the configuration variable `merge.tool`. If the
+
If a merge resolution program is not specified, 'git-mergetool'
will use the configuration variable `merge.tool`. If the
diff --git
a/Documentation/merge-config.txt
b/Documentation/merge-config.txt
index c0f96e70708cab74a13ec8696db003289f99b455..a403155052299dd0aaafd6bdfe0fec92d0d0ac7c 100644
(file)
--- a/
Documentation/merge-config.txt
+++ b/
Documentation/merge-config.txt
@@
-23,7
+23,7
@@
merge.tool::
Controls which merge resolution program is used by
linkgit:git-mergetool[1]. Valid built-in values are: "kdiff3",
"tkdiff", "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff",
Controls which merge resolution program is used by
linkgit:git-mergetool[1]. Valid built-in values are: "kdiff3",
"tkdiff", "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff",
- "diffuse", "ecmerge", "tortoisemerge", "
araxis",
and
+ "diffuse", "ecmerge", "tortoisemerge", "
p4merge", "araxis"
and
"opendiff". Any other value is treated is custom merge tool
and there must be a corresponding mergetool.<tool>.cmd option.
"opendiff". Any other value is treated is custom merge tool
and there must be a corresponding mergetool.<tool>.cmd option.
diff --git
a/contrib/completion/git-completion.bash
b/contrib/completion/git-completion.bash
index e3ddecc995eb30391639983d9f6f0db7567d7b9a..2a9a88968f40ec82ad980b3408a0fc389be02c32 100755
(executable)
--- a/
contrib/completion/git-completion.bash
+++ b/
contrib/completion/git-completion.bash
@@
-953,7
+953,7
@@
_git_diff ()
}
__git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff
}
__git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff
- tkdiff vimdiff gvimdiff xxdiff araxis
+ tkdiff vimdiff gvimdiff xxdiff araxis
p4merge
"
_git_difftool ()
"
_git_difftool ()
diff --git
a/git-mergetool--lib.sh
b/git-mergetool--lib.sh
index bfb01f7842e6192e0b3fbc0e3f2ab96269578289..f7c571e73cdf471148b606242066536361ac7c3d 100644
(file)
--- a/
git-mergetool--lib.sh
+++ b/
git-mergetool--lib.sh
@@
-46,7
+46,7
@@
check_unchanged () {
valid_tool () {
case "$1" in
kdiff3 | tkdiff | xxdiff | meld | opendiff | \
valid_tool () {
case "$1" in
kdiff3 | tkdiff | xxdiff | meld | opendiff | \
- emerge | vimdiff | gvimdiff | ecmerge | diffuse | araxis)
+ emerge | vimdiff | gvimdiff | ecmerge | diffuse | araxis
| p4merge
)
;; # happy
tortoisemerge)
if ! merge_mode; then
;; # happy
tortoisemerge)
if ! merge_mode; then
@@
-130,6
+130,19
@@
run_merge_tool () {
"$merge_tool_path" "$LOCAL" "$REMOTE"
fi
;;
"$merge_tool_path" "$LOCAL" "$REMOTE"
fi
;;
+ p4merge)
+ if merge_mode; then
+ touch "$BACKUP"
+ if $base_present; then
+ "$merge_tool_path" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
+ else
+ "$merge_tool_path" "$LOCAL" "$LOCAL" "$REMOTE" "$MERGED"
+ fi
+ check_unchanged
+ else
+ "$merge_tool_path" "$LOCAL" "$REMOTE"
+ fi
+ ;;
meld)
if merge_mode; then
touch "$BACKUP"
meld)
if merge_mode; then
touch "$BACKUP"
@@
-323,7
+336,7
@@
guess_merge_tool () {
else
tools="opendiff kdiff3 tkdiff xxdiff meld $tools"
fi
else
tools="opendiff kdiff3 tkdiff xxdiff meld $tools"
fi
- tools="$tools gvimdiff diffuse ecmerge araxis"
+ tools="$tools gvimdiff diffuse ecmerge
p4merge
araxis"
fi
if echo "${VISUAL:-$EDITOR}" | grep emacs > /dev/null 2>&1; then
# $EDITOR is emacs so add emerge as a candidate
fi
if echo "${VISUAL:-$EDITOR}" | grep emacs > /dev/null 2>&1; then
# $EDITOR is emacs so add emerge as a candidate