[Python-Dev] Hg: inter-branch workflow

Neil Schemenauer nas at python.ca
Sun Mar 27 21:15:05 CEST 2011


Guido van Rossum <guido at python.org> wrote:
> What is "rebase"? Why does everyone want it and hate it at the same time?

It's the same thing that happens when you do a "svn up" with local
changes in your checkout.  Logically, your patch gets modified so
that it applies on a different (newer) version of the code.

If you don't rebase then those modifications end up getting stored
in the history as merge nodes.  That's quite messy in my opinion and
generally not a good idea.  Rebase is an important tool (which can
at times be abused).

Regarding collapsing multiple comments (and rewriting history in
general), I feel there are two main schools of thought.  One school
considers the development history of a change important and that it
should be preserved: every step and misstep of development should
end up in the public repository.

The other school, which I am a member of, considers a logical
development sequence more important than actual development history.
I like to see a feature or fix developed in smallish, logical steps
and I'm willing to spend a lot of time to rewrite patches to make it
happen.  IMO, future maintainers will thank you for the effort.

Note though, when you are worked with a distributed system, you
should not rebase commits that are in other people's repositories.
In practice this is generally not a problem.  If you have a long
lived branch that you are sharing with other people, you can have a
agreement that everyone will destory their old copy when it is
rebased.  Alternatively, you just take care to only publicly push
logical changes.

Regards,

  Neil



More information about the Python-Dev mailing list