All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: ltuikov@yahoo.com
Cc: git@vger.kernel.org
Subject: Re: resolve (merge) problems
Date: Thu, 01 Dec 2005 16:58:01 -0800	[thread overview]
Message-ID: <7vhd9sb9ie.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20051202000715.8100.qmail@web31810.mail.mud.yahoo.com> (Luben Tuikov's message of "Thu, 1 Dec 2005 16:07:15 -0800 (PST)")

Luben Tuikov <ltuikov@yahoo.com> writes:

> --- Junio C Hamano <junkio@cox.net> wrote:
>> Easier to read is:
>> 
>> 	$ git-diff-files --name-status
>
> Ok 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"
 	;;

  reply	other threads:[~2005-12-02  0:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-01 23:18 resolve (merge) problems Luben Tuikov
2005-12-01 23:58 ` Junio C Hamano
2005-12-02  0:07   ` Luben Tuikov
2005-12-02  0:58     ` Junio C Hamano [this message]
2005-12-02  1:50       ` Luben Tuikov
2005-12-02  1:58         ` Junio C Hamano
2005-12-02  2:05           ` Luben Tuikov
2005-12-02  5:09             ` Junio C Hamano
2005-12-02 13:59               ` Luben Tuikov
2005-12-02  0:07 ` Linus Torvalds
2005-12-02  1:44   ` Luben Tuikov

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=7vhd9sb9ie.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=ltuikov@yahoo.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.