{"thread":{"id":"19130","subject":"[PATCH] Clarify kind of conflict in merge-one-file helper","startedAt":"2009-04-29T21:40:50Z","lastAt":"2009-04-29T21:40:50Z","messageCount":1,"participants":["Alex Riesen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"112699","messageId":"20090429214050.GA13794@blimp.localdomain","threadId":"19130","inReplyTo":null,"subject":"[PATCH] Clarify kind of conflict in merge-one-file helper","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2009-04-29T21:40:50Z","receivedAt":"2009-04-29T21:40:50Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Not as verbose as the recursive merge driver, but better still.\n\nSigned-off-by: Alex Riesen <raa.lkml@gmail.com>\n---\n\n git-merge-one-file.sh |   11 +++++++++--\n 1 files changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/git-merge-one-file.sh b/git-merge-one-file.sh\nindex e1eb963..9c2c1b7 100755\n--- a/git-merge-one-file.sh\n+++ b/git-merge-one-file.sh\n@@ -113,6 +113,10 @@ case \"${1:-.}${2:-.}${3:-.}\" in\n \tsrc1=`git-unpack-file $2`\n \tgit merge-file \"$src1\" \"$orig\" \"$src2\"\n \tret=$?\n+\tmsg=\n+\tif [ $ret -ne 0 ]; then\n+\t\tmsg='content conflict'\n+\tfi\n \n \t# Create the working tree file, using \"our tree\" version from the\n \t# index, and then store the result of the merge.\n@@ -120,7 +124,10 @@ case \"${1:-.}${2:-.}${3:-.}\" in\n \trm -f -- \"$orig\" \"$src1\" \"$src2\"\n \n \tif [ \"$6\" != \"$7\" ]; then\n-\t\techo \"ERROR: Permissions conflict: $5->$6,$7.\"\n+\t\tif [ -n \"$msg\" ]; then\n+\t\t\tmsg=\"$msg, \"\n+\t\tfi\n+\t\tmsg=\"${msg}permissions conflict: $5->$6,$7\"\n \t\tret=1\n \tfi\n \tif [ \"$1\" = '' ]; then\n@@ -128,7 +135,7 @@ case \"${1:-.}${2:-.}${3:-.}\" in\n \tfi\n \n \tif [ $ret -ne 0 ]; then\n-\t\techo \"ERROR: Merge conflict in $4\"\n+\t\techo \"ERROR: $msg in $4\"\n \t\texit 1\n \tfi\n \texec git update-index -- \"$4\"\n-- \n1.6.3.rc3.39.g49fd5\n"}]}