From: Ciaran <ciaranj@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, David Aguilar <davvid@gmail.com>
Subject: Re: [RFC PATCH] Pass empty file to p4merge where no base is suitable.
Date: Sun, 1 May 2011 23:16:02 +0100 [thread overview]
Message-ID: <BANLkTimD_S3ik7-0j0gMCiEo3aoRwCy92Q@mail.gmail.com> (raw)
In-Reply-To: <BANLkTikv0YmB-u74sOrQUQZGQvYJNmBx_w@mail.gmail.com>
Modify the p4merge client command to pass a reference to an empty file
instead of the local file when no base revision available.
In the situation where a merge tries to add a file from one branch
into a branch that already contains that file (by name), p4merge
currently seems to have successfully automatically resolved the
'conflict' when it is opened (correctly if the files differed by
just whitespace for example) but leaves the save button disabled. This
means the user of the p4merge client cannot commit the resolved
changes back to disk and merely exits, leaving the original
(merge-conflicted) file intact on the disk.
Provide an empty base file to p4merge so that it leaves the save
button enabled. This will allow saving of the auto-resolution to
disk.
Signed-off-by: Ciaran Jessup <ciaranj@gmail.com>
---
A hopefully final stab at the patch, which effectively backs out my
version, and implements the suggestions of
Junio C Hamano.
git-mergetool--lib.sh | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index fb3f52b..4db9212 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -258,12 +258,9 @@ run_merge_tool () {
;;
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
+ touch "$BACKUP"
+ $base_present || >"$BASE"
+ "$merge_tool_path" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
check_unchanged
else
"$merge_tool_path" "$LOCAL" "$REMOTE"
--
1.7.4.1
next prev parent reply other threads:[~2011-05-01 22:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-19 19:46 [RFC PATCH] Pass empty file to p4merge where no base is suitable Ciaran
2011-04-19 21:33 ` Junio C Hamano
2011-04-19 22:01 ` Junio C Hamano
2011-05-01 20:47 ` Ciaran
2011-05-01 21:54 ` Junio C Hamano
2011-05-01 22:08 ` Ciaran
2011-05-01 22:16 ` Ciaran [this message]
2011-05-01 23:55 ` Junio C Hamano
2011-05-02 0:01 ` Ciaran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTimD_S3ik7-0j0gMCiEo3aoRwCy92Q@mail.gmail.com \
--to=ciaranj@gmail.com \
--cc=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).