[haiku-development] Re: Git/Hg: some speed tests

  • From: Sean Healy <jalopeura@xxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 4 May 2011 17:56:33 +0100

On 04-May-11 16:35, Ingo Weinhold wrote:

And finally, does hg support updating the local repository without
(temporarily) throw away my local changes?
As far as I understand, that takes 3-4 commands with git which I find
very annoying (git stash, git rebase, git stash apply[, git stash
clear]) -- or is that only relevant when working with SVN as a source
repository?

You might want to rethink your workflow. Before even starting to work on 
something a local branch should be created. And before playing with remote 
repositories local changes should be committed anyway. Uncommitted local 
changes are so svn. :-)

Wait, are you saying that the DEFAULT on both git and hg is to overwrite local changes when updating from another branch? And that to get around that, you have to take several other steps? (That is, either committing your changes to your local branch or stashing them; in each case, at least two commands, IIRC.)

So a tool that theoretically provides more flexibility in workflow is dictating a particular workflow? That seems really wrong-headed to me. The workflow that it's dictating (forcing users to commit changes that may not be ready to be committed) also seems wrong-headed.

It is my understanding that local branches are available to anyone who knows the address of the machine they're stored on. Is this true, or is there a way to mark your branches private so that nobody else can pull them? In that case, requiring a commit of a local branch isn't quite as wrong-headed, because it doesn't allow the world to get at changes that aren't ready.

Of course, it also requires you to save everything twice - once in the OS, once by committing to the local branch, which still seems like a waste of time. If nobody can get at it anyway, why should I commit it before I'm ready to let other people have access? If people can get at it, why should I commit it before I'm ready to let other people have access?

I'm still trying to wrap my head around two conflicting ideas coming out of git (I don't know if they're also valid for hg or not):

1) It takes up less storage space
2) You should create a local branch for everything you work on (because otherwise you'll lose uncommitted changes when you update)

Doesn't point 2 invalidate point 1? If I'm working on four different things, I now have four branches on my hard drive. Even if each individual branch takes up half the space, I'm still using twice the space.

Or do additional branches not take up as much space as the local master branch created by cloning?

Other related posts: