threads / discuss / 3240

Merge problems.

Subject: Merge problems.

## tl;dr

2 messages between Feb 4, 2006 and Feb 5, 2006.

replies: 1people: 2as markdown or json

Ian Molton· Feb 4, 2006, 22:50 UTC · lore
Doing the following:

git checkout -b mywork v2.6.12 # work, work, work git commit -a git merge "Merging happily." mywork v2.6.15

At theat point I get a merge failure - I assume that means I've got conflicts. I forgot to not the exact error.

so I can see unmerged files using git ls-files --unmerged which lists a lot of SHA1 hashes and paths. but most of the files in the list I havent touched! why would they have any conflicts? surely they would simply update 2.6.12->2.6.15 ?

The SHA1 hashes are all listed at least twice per file too, eg.

100644 d058e65daf19f4bb8c257e2273f4c935ccee5121 1 Documentation/DocBook/scsidrivers.tmpl 100644 d058e65daf19f4bb8c257e2273f4c935ccee5121 2 Documentation/DocBook/scsidrivers.tmpl

What does this mean?
How do I work out what needs merging byhand?
Linus Torvalds· Feb 5, 2006, 00:13 UTC · re: Ian Molton · lore

Re: Merge problems.

On Sat, 4 Feb 2006, Ian Molton wrote:
Show 10 quoted lines
>
> Doing the following:
> 
> git checkout -b mywork v2.6.12
> # work, work, work
> git commit -a
> git merge "Merging happily." mywork v2.6.15
> 
> At theat point I get a merge failure - I assume that means I've
> got conflicts. I forgot to not the exact error.

It would be interesting to hear what the error is, but yes, it sounds like file-level conflicts. However, the fact that you get them for files you haven't even touched:

> so I can see unmerged files using git ls-files --unmerged which lists a
> lot of SHA1 hashes and paths. but most of the files in the list I havent
> touched! why would they have any conflicts? surely they would simply
> update 2.6.12->2.6.15 ?

You really shouldn't get any conflicts for anything you haven't touched, since your starting point and the thing you are mergeing to are related, so they shouldn't have any issues.

One common error people have is that the "merge" binary isn't in their path, and the actual error is that the first path you _did_ touch failed to do a three-way merge, and the merge simply has never happened.

If you do _just_ "merge" (no "git", no aguments, no _nothing_), do you get a message like

	merge: not enough arguments
	merge: usage: merge [-AeEpqxX3] [-L lab [-L lab [-L lab]]] file1 file2 file3
	merge aborted
(which is ok) or do you get a message like
	bash: merge: command not found
(which means that you don't have a three-way merge at all)?
If you don't have the merge command, install the rcs package.
> The SHA1 hashes are all listed at least twice per file too, eg.
> 
> 100644 d058e65daf19f4bb8c257e2273f4c935ccee5121 1 Documentation/DocBook/scsidrivers.tmpl
> 100644 d058e65daf19f4bb8c257e2273f4c935ccee5121 2 Documentation/DocBook/scsidrivers.tmpl

That's the "stage1" and "stage2" results. The SHA1's are identical, so it should merge beautifully, and it does sound like the merge was never even really attempted.

So
 - do a "git reset --hard" to undo the partial (undone) merge
 - do "yum install rcs" (or apt get, or whatever) to make sure that you 
   have the three-way merge binary.
 - if it still doesn't work, please make sure to save all the error 
   messages so that we can see them..
Thanks,
		Linus

← back to recent threads