unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
To: "Jan Djärv" <jan.h.d@swipnet.se>
Cc: Uday S Reddy <u.s.reddy@cs.bham.ac.uk>, emacs-devel@gnu.org
Subject: Re: Locks on the Bzr repository
Date: Sun, 22 Aug 2010 02:10:56 +0900	[thread overview]
Message-ID: <87wrrj7uxr.fsf@uwakimon.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <4C6FAC79.1070406@swipnet.se>

Jan Djärv writes:

 > > Whichever way I look at it, I don't see any upside to using bound
 > > branches, but plenty of downside.  So, I am surprised that
 > > emacs-devs choose this mode of operation.
 > 
 > It was recommended here:
 > http://www.emacswiki.org/emacs/BzrForEmacsDevs. Nobody has stepped
 > up and explained in this detail a better way.

I'm beginning to remember what the discussion was.  (Stefan's right,
life would be a lot easier if Emacs just switches to git.)

The basic problem of distributed development is that there is no
physical mainline (this is *why* conflicts can occur; even with a
centralized VCS, for this purpose we can consider multiple workspaces
as virtual -- unrecorded -- branches).  However, most projects are
organized around a mainline (or a small number of mainlines), and of
course for products with a warrantee, the supported versions
implicitly define a mainline in practice.  Darcs completely ignores
the concept of mainline, by viewing a version as a set (not a sequence
or even DAG) of abstract patches, and adding only minimal
dependencies.  git, hg, and bzr view versions as nodes in a graph, the
history DAG.  Traversing the DAG (for example, to produce a log)
requires choices in the presence of branching and merging (if there
are no merges, AFAIK all DVCSes ignore off-current-branch commits in
log and other branch-tracing operations like annotate).

git and hg of course must choose a traversal algorithm (or more
abstractly a way of converting the DAG to a total order), but this is
considered an arbitrary choice (more or less).  Aside from arbitrary
ordering decisions with respect to parallel branches in the DAG, they
only distinguish between merge nodes (ie, those with multiple parents)
and non-merge nodes.  bzr, OTOH, made a deliberate decision to have a
distinguished mainline, actually, a hierarchy of them, indicated by
the order of parents of each node.

Another important design decision in bzr (similar to hg and darcs) is
that the basic model is workspace == branch == repository.  (git
denied this model from the get-go.  git was always designed to manage
a general DAG and from the very beginning allowed different workspaces
to share an object database.)  The idea is to simplify life for the
user by having one active head per workspace, and the user switches
branches by cd'ing to the workspace with the appropriate version
checked out.  However, having only one active head interacts with the
distinguished mainline in, IMO, an unfortunate way: every new commit
is automatically on the mainline!  That is, the mainline is *workspace
[1]relative*.

Having each workspace contain a mainline means that a decision has to
be made in the case of a non-trivial merge.  Which branch's unique
commits are on the mainline?[2]  bzr's design decision is that the
*target* of the merge ("merge source into target") is the new
mainline.  This is consistent with the workspace-relative notion of
mainline that bzr was forced to adopt.[3]  In a hierarchical workflow
like the Linux kernel[4] where changes always flow from contributors
"up" a hierarchy of lieutenants (each with their own "local" mainline)
to the master integrator of "the" mainline, the workspace-relative
notion *implemented* by bzr corresponds closely to the *socially
effective* mainline of the project.

Unfortunately, this idealized workflow can only be realized if
integration is fast enough that contributors can resync to "the"
mainline after their "old" work is committed to "the" mainline, but
before committing new work to the local branch.  (Alternatively, they
can commit whenever they like, but use rebase to ensure that their
workspace DAGs are compatible with the mainline DAG.)

What happens in practice is that contributors are impatient to get new
content from "the" mainline (and perhaps from other "more central"
branches).  So they merge "the" mainline back into their local
branches and start work again.  In bzr, this is *fundamentally wrong*.
For Emacs, socially, the Savannah trunk is the mainline, and
contributors think of it that way.  *But bzr doesn't.*  bzr thinks that
this branch labelled "trunk" is just another branch to be merged into
the mainline, *which by design lives in the local branch*.  The social
mainline and the bzr mainline *must* be different!  (Except in the
case of a project run by a benevolent dictator, and even then, they
only coincide for the dictator.)

So here is the primary role of the bound branch in the workflow
recommended by BzrForEmacsDevs.  It always has the socially-determined
mainline as its bzr mainline.  If you commit something there, it
automatically is committed to the trunk repo as well.  If the trunk
repo has advanced, you can't commit in your bound branch.  You need to
update the workspace and remerge your changes, first.  (The remerge is
automatic unless the update creates conflicts.  Note that you still
need to commit your changes.)

You can achieve the same effect by pulling from trunk into your
unbound integration branch (the branch from which you push) before
doing the merge-commit-push dance there.  The bound branch does not do
an implicit update before merge or commit, although it does do an
implicit push after commit.  So the BzrForEmacsDevs bound branch
workflow might save you some typing, and since it always tries to
commit to the master branch first, you can't screw up the mainline.[5]

Footnotes: 
[1]  In git, OTOH, a record is kept of the source of a branch, and for
remote branches a tracking branch is established to represent the
mainline of that branch.  "The" project mainline is conventionally
called "master" (and of course in workspaces has a tracking branch).
In practice, this works well with a bit of discipline for most people.

[2]  In a DAG-based VCS, it doesn't really make sense to build a
mainline out of some commits from one branch and some from the other,
because that requires breaking the parent-child relationships.

[3]  It's not quite true that there was no alternative.  An
alternative would be that commits in a branch are off-mainline, and
the user makes an explicit decision as to which of the branches being
merged is the mainline at the time of the merge.  git actually had a
UI like this (all parents had to be explicitly stated in a merge
command), but it was quickly abandoned.  (Now HEAD is implicitly the
leftmost parent in all git merges).

[4]  As generally understood; in fact it really needs to work quite
differently.

[5]  In the current configuration of the Savannah trunk, you can't
screw up the mainline anyway.  Your push won't be accepted if it would
cause the trunk mainline to be subordinated to your mainline.
However, this is likely to confuse users; the bound branch is easier
to understand.






  parent reply	other threads:[~2010-08-21 17:10 UTC|newest]

Thread overview: 198+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-19 15:40 Locks on the Bzr repository Stefan Monnier
2010-08-19 15:52 ` Andreas Schwab
2010-08-19 16:07   ` Jan Djärv
2010-08-19 16:36     ` Andreas Schwab
2010-08-19 20:06       ` Jan Djärv
2010-08-19 21:49         ` Andreas Schwab
2010-08-20  6:22           ` Jan Djärv
2010-08-20  7:40             ` Andreas Schwab
2010-08-20  8:57               ` Eli Zaretskii
2010-08-20  9:13                 ` Andreas Schwab
2010-08-20  9:22                   ` Eli Zaretskii
2010-08-20 11:35                     ` Andreas Schwab
2010-08-20 12:24                       ` Eli Zaretskii
2010-08-20 12:56                         ` Óscar Fuentes
2010-08-20 13:29                         ` Andreas Schwab
2010-08-20 14:43                           ` Eli Zaretskii
2010-08-20 10:15                 ` Stephen J. Turnbull
2010-08-20 11:39                   ` Andreas Schwab
2010-08-20 12:42                     ` Stephen J. Turnbull
2010-08-20 12:23                   ` Eli Zaretskii
2010-08-20 12:52                     ` Óscar Fuentes
2010-08-20 13:33                     ` Andreas Schwab
2010-08-20 14:46                       ` Eli Zaretskii
2010-08-20 15:31                         ` Andreas Schwab
2010-08-20 13:44                     ` Stephen J. Turnbull
2010-08-20 15:19                       ` Eli Zaretskii
2010-08-20 22:41                         ` Uday S Reddy
2010-08-21  8:36                           ` Jan Djärv
2010-08-21  9:08                             ` Eli Zaretskii
2010-08-21 10:30                               ` Jan Djärv
2010-08-21 10:41                                 ` Eli Zaretskii
2010-08-21 10:47                                   ` Jan Djärv
2010-08-21 17:04                                   ` Thien-Thi Nguyen
2010-08-22  7:39                                     ` Stephen J. Turnbull
2010-08-23  3:15                                       ` Thien-Thi Nguyen
2010-08-21  9:38                             ` Uday S Reddy
2010-08-21 10:30                               ` Eli Zaretskii
2010-08-21 10:37                               ` Jan Djärv
2010-08-21 10:56                                 ` Eli Zaretskii
2010-08-21 12:51                                 ` Uday S Reddy
2010-08-21 13:02                                   ` Jan Djärv
2010-08-21 15:36                                   ` Eli Zaretskii
2010-08-22  7:39                                     ` Stephen J. Turnbull
2010-08-21 17:10                                 ` Stephen J. Turnbull [this message]
2010-08-21  9:03                           ` Eli Zaretskii
2010-08-21 12:31                             ` Uday S Reddy
2010-08-21 13:45                               ` Óscar Fuentes
2010-08-21 14:56                                 ` Uday S Reddy
2010-08-21 17:32                                   ` Óscar Fuentes
2010-08-22  7:45                                   ` Stephen J. Turnbull
2010-08-21 15:48                               ` Eli Zaretskii
2010-08-21 19:10                               ` Stephen J. Turnbull
2010-08-21 18:59                             ` Stephen J. Turnbull
2010-08-21 19:50                               ` Leo
2010-08-21 19:59                                 ` Eli Zaretskii
2010-08-21 20:17                                   ` Leo
2010-08-21 20:31                                     ` Leo
2010-08-22  1:41                                   ` Tom Tromey
2010-08-22  1:47                                     ` Leo
2010-08-22 13:47                                       ` David De La Harpe Golden
2010-08-22 13:53                                         ` Andreas Schwab
2010-08-22  6:52                                   ` Stephen J. Turnbull
2010-08-22  7:56                                     ` Eli Zaretskii
2010-08-22  8:28                                       ` Stephen J. Turnbull
2010-08-22  8:57                                       ` Leo
2010-08-22 15:11                                         ` Eli Zaretskii
2010-08-21 19:56                               ` Eli Zaretskii
2010-08-21 21:51                                 ` Uday S Reddy
2010-08-21 22:38                                   ` Stefan Monnier
2010-08-22  9:03                                     ` Uday S Reddy
2010-08-22  9:36                                       ` Teemu Likonen
2010-08-22  9:44                                       ` Eli Zaretskii
2010-08-22 11:25                                       ` Stephen J. Turnbull
2010-08-23  4:24                                         ` Richard Stallman
2010-08-23  4:54                                           ` Eli Zaretskii
2010-08-23  7:52                                             ` Glenn Morris
2010-08-23 13:55                                               ` Eli Zaretskii
2010-08-24  4:32                                                 ` Richard Stallman
2010-08-24 13:30                                                 ` Karl Fogel
2010-08-24  4:32                                             ` Richard Stallman
2010-08-23  9:55                                           ` Stephen J. Turnbull
2010-08-23  4:24                                       ` Richard Stallman
2010-08-23  5:06                                         ` Eli Zaretskii
2010-08-23  7:58                                         ` Uday S Reddy
2010-08-23 10:31                                           ` Stephen J. Turnbull
2010-08-23 12:41                                             ` Uday S Reddy
2010-08-24  6:31                                               ` Stephen J. Turnbull
2010-08-24 12:37                                                 ` Lluís
2010-08-24 13:05                                                   ` Lluís
2010-08-24 13:25                                                     ` Óscar Fuentes
2010-08-24 14:18                                                     ` Stephen J. Turnbull
2010-08-24 15:25                                                       ` Lluís
2010-08-24 14:10                                                   ` Stephen J. Turnbull
2010-08-24 15:02                                                     ` Lluís
2010-08-24 16:59                                                     ` Eli Zaretskii
2010-08-24 21:27                                                       ` Óscar Fuentes
2010-08-24 16:42                                                   ` Uday S Reddy
2010-08-24 17:12                                                     ` Lluís
2010-08-24 18:47                                                       ` Uday S Reddy
2010-08-24 14:05                                                 ` Uday S Reddy
2010-08-24 15:54                                                   ` Stephen J. Turnbull
2010-08-24 16:48                                                 ` Eli Zaretskii
2010-08-25 13:03                                           ` Richard Stallman
2010-08-25 13:32                                             ` Juanma Barranquero
2010-08-31 21:33                                               ` Richard Stallman
2010-09-01  0:30                                                 ` Chong Yidong
2010-09-01  1:44                                                   ` Bernardo Barros
2010-09-01  2:36                                                     ` Miles Bader
2010-09-01  3:07                                                   ` Eli Zaretskii
2010-09-01  6:49                                                     ` Stefan Monnier
2010-09-01 18:17                                                   ` Richard Stallman
2010-09-01 19:10                                                     ` Bastien
2010-09-02  5:22                                                       ` Eli Zaretskii
2010-09-02  6:31                                                         ` Bastien
2010-09-03  1:24                                                           ` Richard Stallman
2010-09-03  8:01                                                             ` Eli Zaretskii
2010-09-03  9:50                                                             ` Bastien
2010-09-03 13:58                                                               ` Karl Fogel
2010-08-25 20:25                                             ` Uday S Reddy
2010-08-27 15:36                                               ` Richard Stallman
2010-08-22  7:36                                 ` Stephen J. Turnbull
2010-08-22  8:52                                   ` Eli Zaretskii
2010-08-22  9:21                                     ` Stephen J. Turnbull
2010-08-22  9:38                                       ` Eli Zaretskii
2010-08-22 11:14                                         ` Stephen J. Turnbull
2010-08-22 11:47                                           ` Eli Zaretskii
2010-08-22 11:13                               ` Jan Djärv
2010-08-22 13:13                                 ` Stephen J. Turnbull
2010-08-22 17:10                                   ` Jan Djärv
2010-08-21  2:29                         ` Stephen J. Turnbull
2010-08-20 16:08                 ` bzr smart server [was Re: Locks on the Bzr repository] Glenn Morris
2010-08-20 16:56                   ` Lennart Borgman
2010-08-20 17:11                     ` Eli Zaretskii
2010-08-20 17:13                       ` Lennart Borgman
2010-08-20 17:23                         ` Eli Zaretskii
2010-08-20 17:52                           ` bzr smart server David Kastrup
2010-08-20 17:12                   ` bzr smart server [was Re: Locks on the Bzr repository] Eli Zaretskii
2010-08-20 23:02                     ` bzr smart server Stefan Monnier
2010-08-21  8:05                       ` Eli Zaretskii
2010-08-21 13:22                         ` Óscar Fuentes
2010-08-21 15:31                           ` Eli Zaretskii
2010-08-21 17:09                             ` Óscar Fuentes
2010-08-21 17:28                               ` Eli Zaretskii
2010-08-21 13:46                         ` Miles Bader
2010-08-21 15:32                           ` Eli Zaretskii
2010-08-21 15:45                             ` Miles Bader
2010-08-21 15:51                               ` Eli Zaretskii
2010-08-21 17:16                                 ` Óscar Fuentes
2010-08-21 17:28                                 ` Jason Rumney
2010-08-21 17:36                                   ` Eli Zaretskii
2010-08-21 17:40                                   ` Óscar Fuentes
2010-08-21 14:00                         ` Eric Hanchrow
2010-08-21 14:06                           ` Lennart Borgman
2010-08-21 14:24                             ` Óscar Fuentes
2010-08-21 15:12                               ` Lennart Borgman
2010-08-21 17:12                                 ` Óscar Fuentes
2010-08-22 17:06                       ` Richard Stallman
2010-08-20  4:44         ` Locks on the Bzr repository Miles Bader
2010-08-20  4:52           ` Jason Rumney
2010-08-20  6:22           ` Jan Djärv
2010-08-19 16:26   ` Eli Zaretskii
2010-08-19 16:54     ` Andreas Schwab
2010-08-19 16:12 ` Jason Rumney
2010-08-19 16:43   ` Dan Nicolaescu
2010-08-19 16:48     ` Jason Rumney
2010-08-19 17:08       ` Dan Nicolaescu
2010-08-19 17:32         ` Jason Rumney
2010-08-19 16:24 ` Eli Zaretskii
2010-08-19 17:29   ` Jason Rumney
2010-08-19 21:42     ` Stefan Monnier
2010-08-20  9:06       ` Eli Zaretskii
2010-08-21  9:37         ` Stefan Monnier
2010-08-19 16:26 ` Jay Belanger
2010-08-21 20:36 ` bzr send workflow (Was: Locks on the Bzr repository) Bojan Nikolic
2010-08-21 22:05   ` bzr send workflow Stefan Monnier
2010-08-21 22:48     ` Bojan Nikolic
2010-08-22  5:26     ` No ChangeLog's (was: bzr send workflow) Eli Zaretskii
2010-08-22  8:11       ` Stephen J. Turnbull
2010-08-22  8:58         ` Eli Zaretskii
2010-08-22 12:29     ` bzr send workflow Andreas Schwab
2010-08-22 13:14       ` Eli Zaretskii
2010-08-22 14:52         ` Andreas Schwab
2010-08-23  4:24       ` Richard Stallman
2010-08-23  5:11         ` Eli Zaretskii
2010-08-23  5:30           ` Eli Zaretskii
2010-08-24  4:32           ` Richard Stallman
2010-08-25 15:03     ` Andy Wingo
2010-08-25 19:18       ` Juanma Barranquero
2010-08-26 17:11         ` Chong Yidong
2010-08-26 17:26           ` Juanma Barranquero
2010-08-27  5:20           ` Stephen J. Turnbull
2010-08-27 11:27             ` Wojciech Meyer
2010-08-22  7:56   ` bzr send workflow (Was: Locks on the Bzr repository) Stephen J. Turnbull
2010-08-22 11:11     ` Lennart Borgman
2010-08-22 13:44       ` bzr send workflow Miles Bader
2010-08-22 14:40     ` Bojan Nikolic
2010-08-23  4:14       ` Stephen J. Turnbull
2010-08-23  5:33         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wrrj7uxr.fsf@uwakimon.sk.tsukuba.ac.jp \
    --to=stephen@xemacs.org \
    --cc=emacs-devel@gnu.org \
    --cc=jan.h.d@swipnet.se \
    --cc=u.s.reddy@cs.bham.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).