Boost logo

Boost :

Subject: Re: [boost] [filesystem] [svn] How to remove V2 files without loss of V3 history?
From: Daniel James (dnljms_at_[hidden])
Date: 2012-03-18 12:11:26


On 18 March 2012 15:27, Dave Abrahams <dave_at_[hidden]> wrote:
>
> on Sun Mar 18 2012, Daniel James <dnljms-AT-gmail.com> wrote:
>
>> On 18 March 2012 13:14, Steven Watanabe <watanabesj_at_[hidden]> wrote:
>>>
>>> cd boost/filesystem
>>> svn cp ^/trunk/boost/filesystem ^/branches/filesystem_v3/boost/filesystem
>>> svn switch ^/trunk/boost/filesystem
>>
>> Should that be:
>>
>> svn switch ^/branches/filesystem_v3/boost/filesystem
>>
>>> svn rm *.hpp
>>> svn mv v3/*.hpp .
>>> svn rm v2 v3
>>> # modify headers
>>> svn commit -m "Remove Filesystem V2"
>>> svn switch ^/trunk/boost/filesystem
>>> svn merge --reintegrate ^/branches/filesystem_v3/boost/filesystem
>>> svn commit -m "Merge back to trunk"
>>>
>>> FWIW, if you're doing this in one go, there's
>>> no good reason to create a branch.
>>
>> Also, if we eventually switch to git, I don't think git will
>> understand that the file has moved, since there was already a file in
>> the new location. There might be a benefit to having an intermediate
>> version with the file missing (although, there might not, I don't how
>> well the git conversion will handle it).
>
> I don't think so.  John's SVN->Git conversion knows about svn mv
> operations, but if you delete and recreate a file somewhere else it
> isn't going to realize you moved something.

It doesn't really matter whether the conversion understands 'svn mv',
since git doesn't track moves. So moving one file over another in a
single commit makes that difficult.

For example:

git init
echo 'A' > a.txt
git add a.txt
git commit -m "a.txt"
echo 'B' > b.txt
git add b.txt
git commit -m "b.txt"
git rm a.txt
git mv b.txt a.txt
git commit -m "Move b.txt to a.txt"
git log --follow a.txt

commit 4edcc668a230580ef268446b31528ba343fa0ae0
Author: Daniel James <dnljms_at_[hidden]>
Date: Sun Mar 18 16:10:00 2012 +0000

    Move b.txt to a.txt

commit caf99a35836af843549190e12b8531a9e3bbbe82
Author: Daniel James <dnljms_at_[hidden]>
Date: Sun Mar 18 16:10:00 2012 +0000

    a.txt

Add a remove:

git init
echo 'A' > a.txt
git add a.txt
git commit -m "a.txt"
echo 'B' > b.txt
git add b.txt
git commit -m "b.txt"
git rm a.txt
# Extra remove here:
git commit -m "Remove a.txt"
git mv b.txt a.txt
git commit -m "Move b.txt to a.txt"
git log --follow a.txt

commit ed22d4fef500fb149128ee3a867c24c0c51b76f9
Author: Daniel James <dnljms_at_[hidden]>
Date: Sun Mar 18 16:10:26 2012 +0000

    Move b.txt to a.txt

commit 4a4afd388d012c22bbf9e188fe02702d2cbd5280
Author: Daniel James <dnljms_at_[hidden]>
Date: Sun Mar 18 16:10:26 2012 +0000

    b.txt


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk