git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] Pass empty file to p4merge where no base is suitable.
@ 2011-04-19 19:46 Ciaran
  2011-04-19 21:33 ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Ciaran @ 2011-04-19 19:46 UTC (permalink / raw)
  To: git; +Cc: David Aguilar

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 in-tact 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.

Please note that the empty file is temporarily stored in the location
specified as GIT_DIR/.no_base

Signed-off-by: Ciaran Jessup <ciaranj@gmail.com>
---
Thank you to David Aguilar for his feedback previously on this patch,
hopefully I've followed the submission guidelines correctly this time.
 This patch is to improve the interaction of p4merge and git in the
case where merge conflicts have no common ancestor.  For more detailed
discussion please see: http://marc.info/?l=git&m=130190735601527&w=2
(I was unsure if it was ok to repost inline, sorry)

 git-mergetool--lib.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index fb3f52b..3e007e9 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -262,7 +262,9 @@ run_merge_tool () {
 			if $base_present; then
 				"$merge_tool_path" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
 			else
-				"$merge_tool_path" "$LOCAL" "$LOCAL" "$REMOTE" "$MERGED"
+				touch "$GIT_DIR/.no_base"
+				"$merge_tool_path" "$GIT_DIR/.no_base" "$LOCAL" "$REMOTE" "$MERGED"
+				rm "$GIT_DIR/.no_base"
 			fi
 			check_unchanged
 		else
-- 
1.7.4.1

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

end of thread, other threads:[~2011-05-02  0:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2011-05-01 23:55           ` Junio C Hamano
2011-05-02  0:01             ` Ciaran

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