[Numpy-discussion] DVCS at PyCon

David Cournapeau david@ar.media.kyoto-u.ac...
Fri Apr 10 10:06:18 CDT 2009

Hi Josef,

josef.pktd@gmail.com wrote:
> I tried out mercurial one year ago, including the eclipse plugin, but
> it didn't work very well compared to the svn plugin. And since at that
> time mercurial to svn connection wasn't very good, I gave up (I have
> all my work in svn). I haven't used it since except for checking out
> some repositories. It's time consuming to keep track of 4 different
> version control systems, and for my main use, I'm quite ok with svn
> and minimal use of bzr. I never tried tortoise, because I prefer
> standalone programs or program plugins that don't mess with my windows
> installation or registry, if I'm not sure I use it long-term.

(I am trying different tools, in particular tortoisesvn, and eclipse on
windows, to get a 'feeling' of your workflow, and how that can work out
- or not - for git/hg. I will update the wiki accordingly).

> Now that I see the differences in the branching concept between git
> and the other ones, I can understand that for reviewing patches, the
> git way of branches in the same directory is much faster.  But how do
> you actually run the programs in python? How does python know which
> version to access? Or does git change the content of the files
> whenever you switch a branch?

Yes. That's what checkout is about in git (git checkout is somewhat
equivalent to svn switch - also again, the comparison breaks quickly
because svn switch can be used to switch repositories and or branches,
which does not make sense in git).

For example, to give you a feeling about why I enjoy git very much:

# add branch published by Josef somewhere for review
git remote add stats_branch url_from_josef_useful_stats
# give me all the changes between the master branch (trunk) and your branch
git diff master..stats_branch scipy/stats
# I want to build your changes, so I create a locate branch which tracks
your branch
git branch local_stats stats_branch/master
# Now I 'checkout' the branch, which means updating the working tree
(the files) from the local_stats branch
git co local_stats && build it
# I do some modification to your branch, maybe - I then see a bug in
scipy stats independent of your changes
git stash # put away all the changes in a stash
# Fix the bug
# Return to your changes, checkout the branch, and revert the changes I
was working on previously
git co local_stats
git stash pop

For the release process, something I have used a lot for numpy 1.3.0
through git-svn (if using git, it would be easier, git-svn can be quirky)

# Log for the last few days
git log --since='one week'
# Get an idea of the modified files in the 1.3.x branch: number of lines
git diff --stat svn/branches/1.3.x
# Review changes between the beta and the rc
git diff 1.3.0b1..1.3.0rc1
git log 1.3.0b1..1.3.0rc1
# Something fails building in the rc1, or maybe some tests - check that
the beta did not have this problem by rebuilding
# from scratch
git co 1.3.0b1 && make test_scratch

All this is excruciating on svn. Switching branches is not reliable, and
takes ages (it is of the order of minutes for every single command).
Diffing/log of branches is even worse, and the command line UI is really
painful (I can't understand why I have to use full URL for branches in svn).

One problem which does not concern many people, but which is quite acute
at least for me: I often need to check some changes on several platforms
at the same time (windows/linux, generally). With svn, I have no choice
but to commit every change to svn, and svn acts as the gateway - making
my own local gateway is just too much work. With git, that's relatively
easy (but bzr is easier - that's one thing I really miss from bzr), I
can just make sure everything work instead of making tons of useless and
broken commits.

> Answering my own question, for the record, after some more playing:
> `git checkout branchname` changes files in directory to the branch
> version, updates changed time stamp to date of checkout (i.e.
> modification time of a file in git is useless information)

Yes, git tracks content (that is the whole tree). I did not think about
this, because I never use this information even on svn - I use the
command line. You have to use GUI to notice this problem :)

> I haven't tried ssh with git yet, with bzr and launchpad, half a year
> ago it took several hours of trial and error and googling to get it
> setup, (that was quite a few versions of bzr ago).  With svn,
> authorization to commit to the scipy repository required filling out
> name and password in the svn gui and it worked.

Yes, this would take some time (from people involved in the eventual
transition) to get right. Launchpad was not very good at it. But this is
independent of the DVCS: either bzr, hg or git would need to use a
ssh-based mechanism I think (so the good news is that you have already
done all the work for launchpad :) ).



More information about the Numpy-discussion mailing list