git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: resolve (merge) problems

From
Junio C Hamano <junkio@cox.net>
Date
Dec 1, 2005, 23:58 UTC
Message-ID
<7v3blccqtz.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20051201231844.59450.qmail@web31801.mail.mud.yahoo.com>
Luben Tuikov <ltuikov@yahoo.com> writes:
Show 19 quoted lines
> $ 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.

Previous: Luben TuikovNext: Luben Tuikov
Message 2 of 11 in “resolve (merge) problems”
  1. Luben TuikovDec 1, 2005
  2. Junio C HamanoDec 1, 2005
  3. Luben TuikovDec 2, 2005
  4. Junio C HamanoDec 2, 2005
  5. Luben TuikovDec 2, 2005
  6. Junio C HamanoDec 2, 2005
  7. Luben TuikovDec 2, 2005
  8. Junio C HamanoDec 2, 2005
  9. Luben TuikovDec 2, 2005
  10. Linus TorvaldsDec 2, 2005
  11. Luben TuikovDec 2, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.