diff options
author | Scott Chacon <schacon@gmail.com> | 2009-10-28 14:39:32 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-10-28 16:48:20 -0700 |
commit | c8998b4823cbccd6bd49c2034e242ae7d5873eae (patch) | |
tree | a2e91d8202b7162c500ee1a3f9145040163a8506 /git-mergetool--lib.sh | |
parent | cd0f8e6d63d3e2744d7d3b2329238be7d064a8ea (diff) | |
download | git-c8998b4823cbccd6bd49c2034e242ae7d5873eae.tar.gz |
mergetool--lib: add p4merge as a pre-configured mergetool option
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>
Diffstat (limited to 'git-mergetool--lib.sh')
-rw-r--r-- | git-mergetool--lib.sh | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh index bfb01f7842..f7c571e73c 100644 --- 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 | \ - emerge | vimdiff | gvimdiff | ecmerge | diffuse | araxis) + emerge | vimdiff | gvimdiff | ecmerge | diffuse | araxis | p4merge) ;; # happy tortoisemerge) if ! merge_mode; then @@ -130,6 +130,19 @@ run_merge_tool () { "$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" @@ -323,7 +336,7 @@ guess_merge_tool () { 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 |