* parent-filter loses my merged branch -- what am I doing wrong?
@ 2009-01-19 3:45 Ask Bjørn Hansen
2009-01-19 8:41 ` Johannes Sixt
0 siblings, 1 reply; 3+ messages in thread
From: Ask Bjørn Hansen @ 2009-01-19 3:45 UTC (permalink / raw)
To: git
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
done
Then 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/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: parent-filter loses my merged branch -- what am I doing wrong?
2009-01-19 3:45 parent-filter loses my merged branch -- what am I doing wrong? Ask Bjørn Hansen
@ 2009-01-19 8:41 ` Johannes Sixt
2009-01-20 20:05 ` Ask Bjørn Hansen
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Sixt @ 2009-01-19 8:41 UTC (permalink / raw)
To: Ask Bjørn Hansen; +Cc: git
Ask Bjørn Hansen schrieb:
> 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.
Don't use --parent-filter for this; use grafts. You can see the history in
gitk right away. Later run filter-branch without a filter (except perhaps
the tag-name-filter).
-- Hannes
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: parent-filter loses my merged branch -- what am I doing wrong?
2009-01-19 8:41 ` Johannes Sixt
@ 2009-01-20 20:05 ` Ask Bjørn Hansen
0 siblings, 0 replies; 3+ messages in thread
From: Ask Bjørn Hansen @ 2009-01-20 20:05 UTC (permalink / raw)
To: Johannes Sixt; +Cc: git
On Jan 19, 2009, at 0:41, Johannes Sixt wrote:
> Ask Bjørn Hansen schrieb:
>> 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.
>
> Don't use --parent-filter for this; use grafts. You can see the
> history in
> gitk right away. Later run filter-branch without a filter (except
> perhaps
> the tag-name-filter).
Aha - excellent. I didn't understand clearly from the documentation
that they'd be "written in stone" by filter-branch. Building the
grafts with .git/info/grafts was much much easier.
- ask
--
http://develooper.com/ - http://askask.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-01-20 20:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-19 3:45 parent-filter loses my merged branch -- what am I doing wrong? Ask Bjørn Hansen
2009-01-19 8:41 ` Johannes Sixt
2009-01-20 20:05 ` Ask Bjørn Hansen
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).