parent-filter loses my merged branch -- what am I doing wrong?
- From
Ask Bjørn Hansen <ask@develooper.com>
- Date
- Jan 19, 2009, 03:45 UTC
- Message-ID
- <7578B9A6-BF81-4096-B0FD-F433AD62A41E@develooper.com>
Hi everyone,
I'm converting another svn repository to git (yay). It's only about 1000 commits, but over more than 7 years and a cvs->svn conversion.
On Sam Villain's recommendation I'm spending a bit of time cleaning up the branches and merges with git filter-branch, but I don't think I'm quite understanding how it's supposed to work.
I put the repository up here (about 1MB): git clone git://git.develooper.com/qpsmtpd.git
I started out making a temporary tag for each svn commit, to have easier to use reference points:
for c in `git rev-list --all --date-order --timestamp | sort -n | awk
'{print $2}'`; do
svnid=`git show -s $c | tail -1 | sed 's/.*svn.perl.org\/qpsmtpd
\///' | sed 's/\ .*//' | sed 's/^branches\///'`
git tag -f $svnid $c
doneThen I tried getting the first merge adjusted to show both parents. The commit tagged v010@56 should be the second parent for trunk@57 (the original/other parent for trunk@57 is trunk@20).
I tried using:
git filter-branch --tag-name-filter cat --parent-filter '
if test $GIT_COMMIT = $(git rev-parse trunk@57)
then
echo "-p $(git rev-parse trunk@20) -p $(git rev-
parse v010@56)"
else
cat
fi
' \
master... but that seems to just basically throw away the "v010" branch! What did I do wrong? (Some of the other problems with this repository is that we moved the branches around with "svn mv", so some of the branches don't even have the branch point as a parent; but I'll get back to that when I get this simple case working).
(The script also loses all the temporary tags I added; I thought "-- tag-name-filter cat" would preserve them?)
- ask
-- http://develooper.com/ - http://askask.com/