From: Junio C Hamano Date: Wed, 27 Mar 2013 20:04:01 GMT Subject: Re: Segfault with merge-tree on multiple Git versions Message-ID: <7vtxnwlidq.fsf@alter.siamese.dyndns.org> In-Reply-To: <20130327194521.GQ2286@serenity.lan> John Keeping writes: > You could use a temporary index and do something like: > > rm -f TMP_INDEX > GIT_INDEX_FILE=TMP_INDEX > export GIT_INDEX_FILE > git read-tree -m $base $ours $theirs && > git merge-index git-merge-one-file -a > > then inspect that with "git diff-index --cached $ours". Good. > Note that this will fail if there are conflicts and I don't know what > git-merge-tree will do in that case. I _think_ Charlies's use case is to detect trivial merges to tell the requestee that a merge request can be done on site, so failing is fine when there are conflicts. merge-tree should report conflicts as well.