Mercurial vs Git

Richard Laager rlaager at wiktel.com
Wed Jan 19 21:24:46 EST 2011


On Thu, 2011-01-20 at 01:17 +0200, Felipe Contreras wrote:
> And of course, branches are disposable (supposing I'm 'darkrain'):
> 
>  git checkout master
>  git merge docs # the commit would say 'Merge branch 'docs' into master
>  git push origin master # push the 'master' branch to the 'origin' repo
>  git branch -d docs # delete this branch which won't be used any more

Let's suppose that the tip of Pidgin's main line of development
(trunk/master/etc.) is revision A1.

I make a branch, called "rlaager/foo" (or rlaager.foo or rlaager-foo),
of A1. I commit a change, revision B1. Then I commit another change, B2.
Meanwhile, someone on trunk commits A2 and A3. So we have this:

A1
|  \
A2  B2
|    |
A3  B3

Conceptually, we developers think of A1..A3 as the trunk, and A1..B3 as
the "rlaager/foo" branch. So far, none of these concepts should vary
with any [D]VCS that supports branching.

Now, imagine I merge B3 back into "trunk" to get A4:

A1
|  \
A2  B2
|    |
A3  B3
|  /
| /
|/
A4

This merge is possible in git, hg, and other [D]VCSes not relevant here.

Now, assuming I push this to our central repository in the "usual way"
for git/hg, if John looks at the history, is there a way for him to
identify that B2 and B3 were part of the "rlaager/foo" branch?

As I understand it, with Mercurial, B2 and B3 would be (immutably, I
think) marked as having been a part of the "rlaager/foo" branch, so the
answer would be yes.

As I understand it, in git, branches are basically mutable tags, so the
answer would be no. Is this correct?

Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://pidgin.im/pipermail/devel/attachments/20110119/4e48100b/attachment.sig>


More information about the Devel mailing list