Sanitizing a branch

Alexander Belchenko bialix at ukr.net
Mon Mar 16 10:20:35 GMT 2009


Erik de Castro Lopo пишет:
> Hi all,
> 
> I have a problem that is related to this one:
> 
>    https://lists.ubuntu.com/archives/bazaar/2009q1/054149.html
> 
> I have a project that was imported into Bzr from GNU Arch many years
> ago and has history dating back to early 2004. During the time I've
> hacked on this I have added all sorts of cruft including tests files
> scraps of documentation etc.
> 
> I'd now like to make a public branch of this repo with the public
> branch having none of the cruft but keeping the cruft in my 
> private branch and still have the ability to merge between the
> two relatively painlessly.
> 
> Is this possible? Any clues on how to do it?

No, there is no ready to use tool.
The best match is fast-import-filter and/or rebase, but both fails to satisfy
your main requirement: "public branch having none of the cruft but keeping the cruft in my
private branch and still have the ability to merge between the two relatively painlessly".

You need to replay your history to get the clean public branch but in the same time
keep file ids as in your original branch. fast-import does not keep file-ids (yet?)
and in rebase it's not easy (possible?) to filter out cruft.

You can try to do it manually with rebase, but it seems you have very big history,
so I suspect it'll be very long and boring process.




More information about the bazaar mailing list