Re: resolve (merge) problems
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:14
Luben Tuikov [off-list ref] writes:
quoted hunk
--- Junio C Hamano <junkio@cox.net> wrote:quoted
Easier to read is: $ git-diff-files --name-statusOk this is what it shows: $git-diff-files --name-status U arch/arm/configs/poodle_defconfig D arch/arm/configs/poodle_defconfig U drivers/atm/atmdev_init.c D drivers/atm/atmdev_init.c Unmerged and deleted? Is this correct?
Yes, the first lets you notice it is unmerged, and the second
says the file does not remain in the working tree.
However, there is a bug recently introduced in the
merge-one-file script.
Although the conflict resolution procedure I described applies
if you really had a real conflicting merge, I suspect your merge
should not have failed in the first place.
case "${1:-.}${2:-.}${3:-.}" in
#
# Deleted in both or deleted in one and unchanged in the other
#
"$1.." | "$1.$1" | "$1$1.")
if [ "$2" ]; then
echo "Removing $4"
fi
if test -f "$4"; then
rm -f -- "$4" &&
rmdir -p "$(expr "$4" : '\(.*\)/')" 2>/dev/null
fi &&
exec git-update-index --remove -- "$4"
;;
The faliure code from "rmdir -p" leaks up and makes
git-update-index to be skipped. Here is a fix.
-- >8 --
[PATCH] merge-one-file fix
9ae2172aed289f2706a0e88288909fa47eddd7e7 used "rmdir -p"
carelessly, causing the "git-update-index --remove" to be
skipped.
---diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh
index 739a072..9a049f4 100755
--- a/git-merge-one-file.sh
+++ b/git-merge-one-file.sh@@ -26,7 +26,7 @@ case "${1:-.}${2:-.}${3:-.}" in fi if test -f "$4"; then rm -f -- "$4" && - rmdir -p "$(expr "$4" : '\(.*\)/')" 2>/dev/null + rmdir -p "$(expr "$4" : '\(.*\)/')" 2>/dev/null || : fi && exec git-update-index --remove -- "$4" ;;