From: "David Euresti" <evelio@gmail.com>
To: git@vger.kernel.org
Subject: Problem with merge when renaming
Date: Tue, 18 Sep 2007 13:34:53 -0700 [thread overview]
Message-ID: <95b3d0af0709181334y1e21507ey485860e4d45aa26f@mail.gmail.com> (raw)
Hi,
I think I found a problem when you move a file into a directory of the
same name. Here's what I did.
In a repository I created a directory with a file in it. Commit it.
Then I move the file into a tmp name, make a directory with that name,
and move it into the directory.
git-mv dir/foo dir/foo.bin
mkdir dir/foo
git-mv dir/foo.bin dir/foo/foo.bin
Then in another branch I make a completely unrelated change. I create
a file in another directory.
If I try to merge in the changes from the other branch or if the other
branch tries to merge in these changes I get this error:
dir/foo/foo.bin: unmerged (257cc5642cb1a054f08cc83f2d943e56fd3ebe99)
fatal: git-write-tree: error building trees
Merge with strategy recursive failed.
This is the script I've been using
#!/bin/bash
#
# Make sure it's all clean
rm -rf git-repo
mkdir git-repo
pushd git-repo
git-init
mkdir dir
git-add dir
pushd dir
echo foo > foo
git-add foo
popd
git-commit -a -m "one"
popd
# Developer A moves file into dir of same name
pushd git-repo
git-checkout -b branch-a
git-mv dir/foo dir/foo.bin
mkdir dir/foo
git-mv dir/foo.bin dir/foo/foo.bin
git-commit -a -m "File renamed"
git-checkout master
popd
# Developer B makes completely unrelated changes.
pushd git-repo
git-checkout -b branch-b
echo baz > foo.txt
echo bar > bar.txt
git-add bar.txt
git-add foo.txt
git-commit -a -m "unrelated changes"
git-checkout master
popd
# Developer A wants to merge changes from B
pushd git-repo
#git-merge branch-a
echo
#git-merge branch-b
#popd
next reply other threads:[~2007-09-18 20:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-18 20:34 David Euresti [this message]
2007-09-18 22:12 ` [PATCH] Extend t6020 with another test for d/f interactions Alex Riesen
2007-09-18 22:28 ` Problem with merge when renaming Junio C Hamano
2007-09-18 22:42 ` David Euresti
2007-09-18 22:44 ` Alex Riesen
2007-09-18 23:27 ` Junio C Hamano
2007-09-19 21:11 ` Alex Riesen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=95b3d0af0709181334y1e21507ey485860e4d45aa26f@mail.gmail.com \
--to=evelio@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).