From: Dmitry Potapov <dpotapov@gmail.com>
To: Alex Riesen <raa.lkml@gmail.com>
Cc: Mark Desnoyer <mdesnoyer@gmail.com>, git@vger.kernel.org
Subject: Re: Files not deleted when merging after a rename
Date: Wed, 23 Jan 2008 11:19:42 +0300 [thread overview]
Message-ID: <20080123081942.GM14871@dpotapov.dyndns.org> (raw)
In-Reply-To: <20080122072825.GA2971@steel.home>
On Tue, Jan 22, 2008 at 08:28:25AM +0100, Alex Riesen wrote:
>
> Were these subdirectories containing exclusively tracked files?
> Or is it Winblows and some process was blocking the deletion?
The issue is not Windows specific and the problem can be reproduced
with different versions of Git including the latest from Git master.
In fact, user B does not have to made any changes, it is enough that
merge was not fast-forward. In contrast with fast-forward merge, which
just update the references, the recursive merge requires the working
directory to perform the merge. Because directories are not trucked,
there is no way to tell at the end whether an empty directory was
created by user before or it became empty as result of merge.
Probably, the problem can be solved by remembering the list of empty
directories before performing a real merge and then, on success, to
remove all empty directories that are not in that list.
Here is a script that demonstrates the issue.
=== CUT ===
#!/bin/sh
set -e
rm -rf shared userA userB
mkdir shared
cd shared
git init
mkdir -p foo/bar
for line in Files not deleted when merging after a rename; do
echo $line; done > foo/bar/testfile
git add foo/bar/testfile
git commit -m 'add foo/bar/testfile'
cd ..
git clone file://$PWD/shared/.git userA
git clone file://$PWD/shared/.git userB
cd userA
git mv foo/bar bar
git commit -m 'mv foo/bar bar'
git push
cd ..
cd userB
echo 'more' >> foo/bar/testfile
git commit -a -m 'edit foo/bar/testfile'
git pull
find *
=== CUT ===
next prev parent reply other threads:[~2008-01-23 8:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-21 19:45 Files not deleted when merging after a rename Mark Desnoyer
2008-01-21 21:20 ` Alex Riesen
2008-01-21 21:45 ` Mark Desnoyer
2008-01-22 7:28 ` Alex Riesen
2008-01-23 2:08 ` Mark Desnoyer
2008-01-24 7:52 ` Alex Riesen
2008-01-23 8:19 ` Dmitry Potapov [this message]
2008-01-24 7:56 ` 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=20080123081942.GM14871@dpotapov.dyndns.org \
--to=dpotapov@gmail.com \
--cc=git@vger.kernel.org \
--cc=mdesnoyer@gmail.com \
--cc=raa.lkml@gmail.com \
/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).