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

  • From: Ryan Leavengood <leavengood@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 4 May 2011 19:06:34 -0400

On Wed, May 4, 2011 at 6:48 PM, Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:
>
> I tried to reproduce the situation with git, but regardless of the commit 
> order I always
> end up with the merge commit on top. E.g. (3 repositories):

If you use git pull --rebase you don't get the merge commit.

> central: 1
> a:       1
> b:       1
>
> Change and commit in b:
>
> central: 1
> a:       1
> b:       1 - 2b
>
> Change and commit in a, plus push to central:
>
> central: 1 - 2a
> a:       1 - 2a
> b:       1 - 2b
>
> Pull from central in b:
>
> central: 1 - 2a
> a:       1 - 2a
> b:       1 - 2b - 2a - merge

Pull --rebase from central in b:

central: 1 - 2a
a:       1 - 2a
b:       1 - 2a - 2b

> Push to central from b and pull from central in a:
>
> central: 1 - 2b - 2a - merge
> a:       1 - 2b - 2a - merge
> b:       1 - 2b - 2a - merge

Push from b, pull --rebase to a (though in this case the rebase is unneeded):

central: 1 - 2a - 2b
a:       1 - 2a - 2b
b:       1 - 2a - 2b

Things are more linear and repos more in sync when using rebase,
though there is no guarantee that 2a was dated before 2b, only that it
was pushed to central first.

Plus using --rebase is more of a convention/preference, not a requirement.

-- 
Regards,
Ryan

Other related posts: