What is better way to remove commit from history?

Jelmer Vernooij jelmer at samba.org
Sat Mar 29 03:52:51 GMT 2008


On Fr, 2008-03-28 at 09:09 +0200, Alexander Belchenko wrote:
> Jelmer Vernooij пишет:
> > On Di, 2008-03-18 at 14:25 +0200, Alexander Belchenko wrote:
> >> James Westby пишет:
> >>> On Tue, 2008-03-18 at 13:01 +0200, Alexander Belchenko wrote:
> >>>> I have some branch where I commit wrong thing. After that I have 5 another commits.
> >>>> And only then I realize that committed file is completely wrong therefore
> >>>> should not be used in real work.
> >>>>
> >>>> I'd like to cleanup history of my branch (rewrite it) to remove that wrong commit.
> >>>> What is the best way to do this? rebase? loom?
> >>> rebase is the strategy to use I think.
> >>>
> >>> Unfortunately I can't give you exact instructions of how to do it with
> >>> the bzr-rebase tool, sorry.
> >> OK, I found solution: rebase --onto.
> >>
> >> I had wrong revno 79, and good revisions after it with revnos 80-82.
> >> So I did this:
> >>
> >> bzr rebase -r80..82 --onto 78 .
> >>
> >> And this command effectively removes old wrong revno 79 from my history.
> >> Nice :-).
> >>
> >> Jelmer, may be it's worth to put such recipe into rebase user manual or FAQ?
> > Yep, I just filed a bug about this.
> > 
> >> Also I found that:
> >>
> >> * rebase does not preserve name/email of original committer, though it preserve datestamp
> >> and branch nick. Is it intended behavior?
> > Yes - you'll notice that the author property is actually preserved. 
> 
> But if there is no author -- original committer name is lost. IMO, in this case (if author is empty) original committer 
> should be stored in new revision as author.
> Do you disagree?
I agree, it should retain the original committer name. This was already
fixed in my local branch but wasn't updated by launchpad yet. I've
pushed it now.

Cheers,

Jelmer

-- 
Jelmer Vernooij <jelmer at samba.org> - http://samba.org/~jelmer/
Jabber: jelmer at jabber.fsfe.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080329/19a7eef2/attachment-0001.pgp 


More information about the bazaar mailing list