[IPython-dev] how to contribute to ipython
Thu Jul 16 15:56:58 CDT 2009
On Thu, Jul 16, 2009 at 2:30 PM, Ondrej Certik<firstname.lastname@example.org> wrote:
> On Thu, Jul 16, 2009 at 2:27 PM, Ondrej Certik<email@example.com> wrote:
>> On Thu, Jul 16, 2009 at 12:33 PM, Ondrej Certik<firstname.lastname@example.org> wrote:
>>> On Thu, Jul 16, 2009 at 12:06 PM, Ville M. Vainio<email@example.com> wrote:
>>>> On Thu, Jul 16, 2009 at 8:39 PM, Ondrej Certik<firstname.lastname@example.org> wrote:
>>>>> Ok, so I will keep committing. But here is a real problem. I commitetd
>>>>> with an email address ondrej@crow by a mistake and I would like to use
>>>>> my real address, before you merge it in. In other words, I need to fix
>>>>> last two commits. How can I do that?
>>>> If you don't mind some low-tech legwork, you can do a new branch and
>>>> get your changes there by bzr diff + standard 'patch' app.
>>> Well, what are my options?
>>> 1) have ondrej@crow in the ipython history
>>> 2) use the old good patch app.
>>> Well, I do want to fix my email address. Imagine I noticed after
>>> committing ~20 patches. I would not be happy to rework everything
>>> using "patch". For comparison, with git, I would do:
>>> git rebase -i HEAD~20 # assuming I have 20 patches to fix
>>> # vim fires up, I change "e" next to each patch I want to edit and then
>>> git --amend --author="Ondrej Certik <my correct email address>"
>>> git rebase --continue
>>> # repeat the last two commands 20 times
>>> and I am done. Let me search the internet, there must be some better
>>> way than to do a new branch and rework everything from scratch.
>> Ok, so there is a better way.
>> First I did "bzr whoami <correct name+email>" and this fixes the email
>> in the last commit:
>> bzr uncommit
>> bzr commit -m "set_trace() moved from __init__.py to ipapi.py"
>> Yes, I have to recommit the log (git allow you to reuse the log of the
>> old, deleted, commit), but it's already a big step forward.
>> However, now I have this problem:
>> $ bzr push
>> Using saved push location:
>> bzr: ERROR: These branches have diverged. Try using "merge" and then "push".1
>> I just changed my email. Git has "git push -f", which rewrites the
>> remote branch. Ok, let me dig some more into this.
> Very cool, now this works!
> $ bzr push --overwrite
> Using saved push location:
> Pushed up to revision 1176.
> So now the only problem is to figure out how to fix the 2nd commit from top.
Ok, so I created a new branch set_trace2 and then just merged one
commit from set_trace. When I did "bzr merge -r 1175 ../set_trace", it
merged it, but "bzr diff" still shows the diff. So I committed it and
now "bzr log" shows two commits, the old one and my new one. So I am
confused, I thought that a merge would just take the commit and put it
on top of my set_trace2 branch. I think I should have used "bzr pull".
So I created set_trace3 and used "bzr pull", now it works.
I applied my trick above with changing the email (havig to copy the
log message by hand sucks, but it works). Unfortunately, I am not able
to pull the next commit anymore:
$ bzr pull -r 1176 ../set_trace
bzr: ERROR: These branches have diverged. Use the merge command to
So that's a real problem now. If I use merge, it will merge it but it
will be a mess. So let's use patch, that works nice (except that I
have to commit the log by hand once again).
Ok, so here is my reworked branch:
So this worked fine. But if I had 20 patches to fix, I am afraid there
is no way to do it. Working with 20 patches by hand and "patch", and
copy & pasting 20 log messages, well, that would be a pain.
More information about the IPython-dev