git.vger.kernel.org archive mirror
 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 15:58:32 -0800	[thread overview]
Message-ID: <7v3blccqtz.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20051201231844.59450.qmail@web31801.mail.mud.yahoo.com> (Luben Tuikov's message of "Thu, 1 Dec 2005 15:18:44 -0800 (PST)")

Luben Tuikov <ltuikov@yahoo.com> writes:

> $ git resolve HEAD master "merge linus' tree"
> Trying to merge 5666c0947ede0432ba5148570aa66ffb9febff5b into
> 32df3299405fb7054b76346899f3db2fa29150fb using 458af5439fe7ae7d95ca14106844e61f0795166c.
> Simple merge failed, trying Automatic merge
> Removing arch/arm/configs/poodle_defconfig
> Removing drivers/atm/atmdev_init.c
> fatal: merge program failed
> Automatic merge failed, fix up by hand
>
> How do I proceed from here?
>
> The output from git-diff-index is:
>
> $git-diff-index --name-status HEAD
> M       Documentation/usb/error-codes.txt
> M       Makefile
> M       arch/arm/configs/corgi_defconfig
> U       arch/arm/configs/poodle_defconfig
> M       arch/arm/configs/spitz_defconfig

Easier to read is:

	$ git-diff-files --name-status

which would tell you that there two files have conflicting
changes:

U       arch/arm/configs/poodle_defconfig
U       drivers/atm/atmdev_init.c

and you would hopefully not see anything else (you saw tons of
paths only because you compared against HEAD, which shows not
just conflicts but everything the merge brought in).

	$ git diff arch/arm/configs/poodle_defconfig drivers/atm/atmdev_init.c

would give you the diff between your version (before merging)
and the half-merged file with conflict markers.  Resolve them
just like you would resolve conflicting changes.  I would
usually just open these files in an editor, and pick one of the
sections between <<< == >>> these markers.

One nifty tool I saw suggested on the list recently was xxdiff:

	$ xxdiff -U arch/arm/configs/poodle_defconfig

No matter how you would resolve, the first goal of yours is to
get these files in your working tree into a good shape, which
may involve compiling and testing.  Once you have these files in
a good enough shape, you tell git that you are done with them:

	$ git update-index \
        	arch/arm/configs/poodle_defconfig drivers/atm/atmdev_init.c

and commit.

	$ git commit

The commit message editor would loudly warn you that you are
committing a merge, but that is OK because that is what you are
doing.  You might want to describe how you resolved (which side
you picked) the conflicting changes in the log, in addition to
the standard boilerplate "merged that branch" message.

  reply	other threads:[~2005-12-01 23: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 [this message]
2005-12-02  0:07   ` Luben Tuikov
2005-12-02  0:58     ` Junio C Hamano
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=7v3blccqtz.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 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).