Purging parts of a branch's history?
Staffan Gimåker
staffan at gimaker.se
Tue Aug 12 15:48:18 BST 2008
On Thursday 31 July 2008 17:36:52 John Arbash Meinel wrote:
> | Is it possible to remove parts of the history from a bzr branch? I
[snip]
> Yes, you generally would have to use 'bzr-rebase' to prune bits of history.
>
> I don't have an exact recipe for you, but something like:
>
> bzr init new_branch
> cd new_branch
> bzr pull -r XX ../old_branch (pull whatever you think is *good* to keep)
> bzr rebase -r YY..ZZ ../old_branch
>
> Or something along those lines.
I still can't figure out how to do what I want. Just to clarify, I only want
to remove parts of the history, not the actual content - i.e. I want to loose
the first X commit message (they are total nonsense).
After re-reading the documentation of rebase, AFAIK, it can only "move" the
changesets around, not remove history metadata while preserving the content.
Correct?
That made me think that this would work (assuming I want to kill of the first
100 revisions):
$ bzr init new_branch
$ cd new_branch
$ bzr diff -r0..100 ../old_branch | bzr patch
$ bzr add; bzr ci -m "Initial import."
(new_branch is now identical to old_branch at rev. 100)
$ cd ../old_branch/
$ bzr rebase -r101.. --onto=1 ../new_branch
Obviously, I'm not groking it since I get a bunch of conflicts at once:
Conflict adding files to src. Created directory.
Conflict because src is not versioned, but has versioned children. Versioned
directory.
Conflict adding file src. Moved existing file to src.moved.
Contents conflict in src/Connection.cc
Any ideas?
> I would question the real need to do the pruning. I won't say you
> shouldn't, just that the effort to prune is probably not worth as much
> as putting your effort towards improving the project :)
I was kind of hoping it would be a quick and painless... guess not.
--
Staffan Gimåker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080812/f10bad95/attachment.pgp
More information about the bazaar
mailing list