On Thu, 21 Apr 2005, Linus Torvalds wrote:
> You can also use it to test merges without screwing up your old index file 
> in case something goes wrong.

Btw, if it wasn't obvious, for the merge thing to work you need to first
copy the old index file _or_ generate a new temporary index file first, so
that doing the three-way merge has a previous index file to work with. Ie
it would look something like

        cp .git/index .tmp-index
        GIT_INDEX_FILE=.tmp-index read-tree -m $orig $branch1 $branch2

but this same approach can also be used to merge things _without_ actually
having any specific version checked out, in which case it would just be

        GIT_INDEX_FILE=.tmp-index read-tree $orig
        GIT_INDEX_FILE=.tmp-index read-tree -m $orig $branch1 $branch2

which allows you to create a merged index file that is totally independent 
on whatever (if anything) you happen to be working on right now.

Together with a SHA1_FILE_DIRECTORY, it allows you to do merges entirely
outside any real git tree, and without any other setup. That's quite nice
for the case where your actual working tree may be dirty, and you don't
want to mess around in it.

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to