I think the answer is simple. Simply set your email using whoami like the bzr 5 minute guide says:<br><br><a href="http://doc.bazaar-vcs.org/latest/en/mini-tutorial/index.html#introducing-yourself">http://doc.bazaar-vcs.org/latest/en/mini-tutorial/index.html#introducing-yourself</a><br>
<br>and then keep committing. In bzr (at least in how I use it) a commit is used in the same sense that it is in a database transaction. Namely, once you commit, there is no going back. <br><br>Once you accept that this is what "commit" means, your hypothetical of "what if I had to change 20 commits" doesn't make sense. Again, the bottom line is that the conceptual model of bzr is different from git (at least in this area).<br>
<br>Cheers,<br><br>Brian<br><br><br><br><div class="gmail_quote">On Thu, Jul 16, 2009 at 1:56 PM, Ondrej Certik <span dir="ltr"><<a href="mailto:ondrej@certik.cz">ondrej@certik.cz</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On Thu, Jul 16, 2009 at 2:30 PM, Ondrej Certik<<a href="mailto:ondrej@certik.cz">ondrej@certik.cz</a>> wrote:<br>
> On Thu, Jul 16, 2009 at 2:27 PM, Ondrej Certik<<a href="mailto:ondrej@certik.cz">ondrej@certik.cz</a>> wrote:<br>
>> On Thu, Jul 16, 2009 at 12:33 PM, Ondrej Certik<<a href="mailto:ondrej@certik.cz">ondrej@certik.cz</a>> wrote:<br>
>>> On Thu, Jul 16, 2009 at 12:06 PM, Ville M. Vainio<<a href="mailto:vivainio@gmail.com">vivainio@gmail.com</a>> wrote:<br>
>>>> On Thu, Jul 16, 2009 at 8:39 PM, Ondrej Certik<<a href="mailto:ondrej@certik.cz">ondrej@certik.cz</a>> wrote:<br>
>>>><br>
>>>>> Ok, so I will keep committing. But here is a real problem. I commitetd<br>
>>>>> with an email address ondrej@crow by a mistake and I would like to use<br>
>>>>> my real address, before you merge it in. In other words, I need to fix<br>
>>>>> last two commits. How can I do that?<br>
>>>><br>
>>>> If you don't mind some low-tech legwork, you can do a new branch and<br>
>>>> get your changes there by bzr diff + standard 'patch' app.<br>
>>><br>
>>> Well, what are my options?<br>
>>><br>
>>> 1) have ondrej@crow in the ipython history<br>
>>> 2) use the old good patch app.<br>
>>><br>
>>> Well, I do want to fix my email address. Imagine I noticed after<br>
>>> committing ~20 patches. I would not be happy to rework everything<br>
>>> using "patch". For comparison, with git, I would do:<br>
>>><br>
>>> git rebase -i HEAD~20 # assuming I have 20 patches to fix<br>
>>> # vim fires up, I change "e" next to each patch I want to edit and then<br>
>>> git --amend --author="Ondrej Certik <my correct email address>"<br>
>>> git rebase --continue<br>
>>> # repeat the last two commands 20 times<br>
>>><br>
>>> and I am done. Let me search the internet, there must be some better<br>
>>> way than to do a new branch and rework everything from scratch.<br>
>><br>
>> Ok, so there is a better way.<br>
>><br>
>> First I did "bzr whoami <correct name+email>" and this fixes the email<br>
>> in the last commit:<br>
>><br>
>> bzr uncommit<br>
>> bzr commit -m "set_trace() moved from __init__.py to ipapi.py"<br>
>><br>
>> Yes, I have to recommit the log (git allow you to reuse the log of the<br>
>> old, deleted, commit), but it's already a big step forward.<br>
>><br>
>> However, now I have this problem:<br>
>><br>
>> $ bzr push<br>
>> Using saved push location:<br>
>> bzr+ssh://<a href="http://bazaar.launchpad.net/%7Eipython-dev/ipython/set_trace/" target="_blank">bazaar.launchpad.net/~ipython-dev/ipython/set_trace/</a><br>
>> bzr: ERROR: These branches have diverged. Try using "merge" and then "push".1<br>
>><br>
>> I just changed my email. Git has "git push -f", which rewrites the<br>
>> remote branch. Ok, let me dig some more into this.<br>
><br>
> Very cool, now this works!<br>
><br>
> $ bzr push --overwrite<br>
> Using saved push location:<br>
> bzr+ssh://<a href="http://bazaar.launchpad.net/%7Eipython-dev/ipython/set_trace/" target="_blank">bazaar.launchpad.net/~ipython-dev/ipython/set_trace/</a><br>
> Pushed up to revision 1176.<br>
><br>
> So now the only problem is to figure out how to fix the 2nd commit from top.<br>
<br>
</div></div>Ok, so I created a new branch set_trace2 and then just merged one<br>
commit from set_trace. When I did "bzr merge -r 1175 ../set_trace", it<br>
merged it, but "bzr diff" still shows the diff. So I committed it and<br>
now "bzr log" shows two commits, the old one and my new one. So I am<br>
confused, I thought that a merge would just take the commit and put it<br>
on top of my set_trace2 branch. I think I should have used "bzr pull".<br>
So I created set_trace3 and used "bzr pull", now it works.<br>
<br>
I applied my trick above with changing the email (havig to copy the<br>
log message by hand sucks, but it works). Unfortunately, I am not able<br>
to pull the next commit anymore:<br>
<br>
$ bzr pull -r 1176 ../set_trace<br>
bzr: ERROR: These branches have diverged. Use the merge command to<br>
reconcile them.<br>
<br>
So that's a real problem now. If I use merge, it will merge it but it<br>
will be a mess. So let's use patch, that works nice (except that I<br>
have to commit the log by hand once again).<br>
<br>
Ok, so here is my reworked branch:<br>
<br>
<a href="https://code.edge.launchpad.net/%7Eipython-dev/ipython/set_trace" target="_blank">https://code.edge.launchpad.net/~ipython-dev/ipython/set_trace</a><br>
<br>
<br>
So this worked fine. But if I had 20 patches to fix, I am afraid there<br>
is no way to do it. Working with 20 patches by hand and "patch", and<br>
copy & pasting 20 log messages, well, that would be a pain.<br>
<font color="#888888"><br>
Ondrej<br>
</font></blockquote></div><br>