Subject: | git-stitch-repo creates unnecessary branches when joining two repositories |
Date: | Fri, 2 Sep 2011 12:20:14 +0100 |
To: | bug-Git-FastExport [...] rt.cpan.org |
From: | James Blackburn <jamesblackburn [...] gmail.com> |
Hi,
I have a test case of two repositories which, when stitched appears to
have unnecessary / confusing branching.
Reproduction steps:
git clone git://github.com/jamesblackburn/org.eclipse.cdt.dsf.git
git clone git://github.com/jamesblackburn/org.eclipse.cdt.dsf.ui.git
mkdir stitched
cd stitched
git init
git-stitch-repo ../org.eclipse.cdt.dsf:dsf/org.eclipse.cdt.dsf
../org.eclipse.cdt.dsf.ui:dsf/org.eclipse.cdt.dsf.ui |git fast-import
If you look at these two repos with gitk --all, nearly all the commits
are on the mainline master branch. There are a couple of side
branches which are tagged.
Importantly (for me) all the 3.X-X tags are on the master branch.
Having stitched the repo I end up with a more complicated history:
- both masters are now on two different branches
- the 3.X-X tags are on different branches
The result is I can't unify the tags / branches.
If you remove the side branches by removing the tags:
cd ../org.eclipse.cdt.dsf.ui/
for tag in `git tag -l v20*` ; do git tag -d $tag ; done
git tag -d CDT_6_0_0 CDT_6_0_2
cd ../org.eclipse.cdt.dsf/
for tag in `git tag -l v20*` ; do git tag -d $tag ; done
git tag -d CDT_6_0_0 CDT_6_0_2
Then restitching gives nicely linear history. (I just noticed that
only the two tags: CDT_6_0_0 CDT_6_0_2 are needed to reproduce this
odd behaviour.)
Any ideas on what might be the cause of this?
Cheers,
James