tags:

views:

117

answers:

2

Well, imagine current.txt file :

asdf

base.txt file :

asdf

other.txt file :

asdf

when I do a three-way merge with

git merge-file current.txt base.txt other.txt

current.txt file become empty, why ? In other case current.txt file become a merge of the 3 files

A: 

Sounds like a bug in git-merge-file, to me. You should ask this question on the git mailing list. I think you're likely to get a better answer there. The guys that monitor that list are pretty sharp and would know whether or not this is intended behavior.

Dan Moulding
+1  A: 

This is probably a bug in git merge-file, but not one that is every going to be triggered in practice.

git merge-file is not a command targetted for end user use but is used internally by git as part of a merge or rebase activity. It will only be called on files that have actually changed so passing three files to git merge-file that all have identical contents won't happen in practice.

EDIT: I've proposed a patch to fix this, although it will need expert review: gmane link

EDIT: This bug will be fixed in v1.6.3.2 and later versions of git.

Charles Bailey
+1 for the patch
Dan Moulding