some updates after 2 years of Mercurial usage;
authorwenzelm
Thu Nov 18 22:34:32 2010 +0100 (2010-11-18)
changeset 40601021278fdd0a8
parent 40600 c2ca0eb91d99
child 40613 23626b388e07
some updates after 2 years of Mercurial usage;
README_REPOSITORY
     1.1 --- a/README_REPOSITORY	Thu Nov 18 18:12:03 2010 +0100
     1.2 +++ b/README_REPOSITORY	Thu Nov 18 22:34:32 2010 +0100
     1.3 @@ -1,32 +1,41 @@
     1.4  Important notes on Mercurial repository access for Isabelle
     1.5  ===========================================================
     1.6  
     1.7 -Preamble
     1.8 ---------
     1.9 +Introduction
    1.10 +------------
    1.11  
    1.12 -Mercurial http://www.selenic.com/mercurial belongs to a new generation
    1.13 -of source code management systems, following the paradigm of
    1.14 -"distributed version control".  Compared to the old centralized model
    1.15 -of CVS or SVN, this gives considerable more power and freedom in
    1.16 -organizing the flow of changes, both between individual developers and
    1.17 -designated pull/push areas that are shared with others.
    1.18 +Mercurial http://www.selenic.com/mercurial belongs to the current
    1.19 +generation of source code management systems that follow the so-called
    1.20 +paradigm of "distributed version control".  This is a terrific name
    1.21 +for plain revision control without the legacy of CVS or SVN.  See also
    1.22 +http://hginit.com/ for an introduction to the main ideas.  The
    1.23 +Mercurial book http://hgbook.red-bean.com/ explains many more details.
    1.24 +
    1.25 +Mercurial offers great flexibility in organizing the flow of changes,
    1.26 +both between individual developers and designated pull/push areas that
    1.27 +are shared with others.  This additional power demands some additional
    1.28 +responsibility to maintain a certain development process that fits to
    1.29 +a particular project.
    1.30  
    1.31 -More power for the user also means more responsibility!  Due to its
    1.32 -decentralized nature, changesets that have been published once,
    1.33 -e.g. via "push" to a shared repository that is visible on the net,
    1.34 -cannot be easily retracted from the public again.  Regular Mercurial
    1.35 -operations are strictly monotonic, where changset transactions are
    1.36 -only added, but never deleted.  There are special tools to manipulate
    1.37 -individual repositories via non-monotonic actions, but this does not
    1.38 -yet retrieve any changesets that have escaped into the public by
    1.39 -accident.
    1.40 +Regular Mercurial operations are strictly monotonic, where changeset
    1.41 +transactions are only added, but never deleted.  There are special
    1.42 +tools to manipulate repositories via non-monotonic actions (such as
    1.43 +"rollback" or "strip"), but recovering from gross mistakes that have
    1.44 +escaped into the public can be hard and embarrassing.  It is much
    1.45 +easier to inspect and amend changesets routinely before pushing.
    1.46  
    1.47 -Only global operations like "pull" and "push" fall into this critical
    1.48 -category.  Note that "incoming" / "outgoing" allow to inspect
    1.49 -changesets before exchanging them globally.  Anything else in
    1.50 -Mercurial is local to the user's repository clone (including "commit",
    1.51 -"update", "merge" etc.) and is in fact much simpler and safer to use
    1.52 -than the corresponding operations of CVS or SVN.
    1.53 +The effect of the critical "pull" / "push" operations can be tested in
    1.54 +a dry run via "incoming" / "outgoing".  The "fetch" extension includes
    1.55 +useful sanity checks beyond raw "pull" / "update" / "merge".  Most
    1.56 +other operations are local to the user's repository clone.  This gives
    1.57 +some freedom for experimentation without affecting anybody else.
    1.58 +
    1.59 +Mercurial provides nice web presentation of incoming changes with a
    1.60 +digest of log entries; this also includes RSS/Atom news feeds.  There
    1.61 +are add-on browsers, notably hgtk that is part of the TortoiseHg
    1.62 +distribution and works for generic Python/GTk platforms.  The
    1.63 +alternative "view" utility helps to inspect the semantic content of
    1.64 +merge nodes.
    1.65  
    1.66  
    1.67  Initial configuration
    1.68 @@ -40,70 +49,67 @@
    1.69  name is specified.  The full repository meta-data and history of
    1.70  changes is in isabelle/.hg; local configuration for this clone can be
    1.71  added to isabelle/.hg/hgrc, but note that hgrc files are never copied
    1.72 -by another clone operation!
    1.73 +by another clone operation.
    1.74  
    1.75  
    1.76  There is also $HOME/.hgrc for per-user Mercurial configuration.  The
    1.77 -initial configuration should include at least an entry to identify
    1.78 -yourself.  For example, something like this in /home/wenzelm/.hgrc:
    1.79 +initial configuration requires at least an entry to identify yourself
    1.80 +as follows:
    1.81  
    1.82    [ui]
    1.83 -  username = wenzelm
    1.84 +  username = XXX
    1.85  
    1.86 -Of course, the user identity can be also configured in
    1.87 -isabelle/.hg/hgrc on per-repository basis.  Failing to specify the
    1.88 -username correctly makes the system invent funny machine names that
    1.89 -may persist indefinitely in the public flow of changesets.
    1.90 +Isabelle contributors are free to choose either a short "login name"
    1.91 +(for accounts at TU Munich) or a "full name" -- with or without mail
    1.92 +address.  It is important to stick to this choice once and for all.
    1.93 +The machine default that Mercurial produces for unspecified
    1.94 +[ui]username is not appropriate.
    1.95  
    1.96 -In principle, user names can be chosen freely, but for longterm
    1.97 -committers of the Isabelle repository the obvious choice is to keep
    1.98 -with the old CVS naming scheme.  Others should use their regular "full
    1.99 -name"; including an email address is optional.
   1.100 +Such configuration can be given in $HOME/.hgrc (for each home
   1.101 +directory on each machine) or in .hg/hgrc (for each repository clone).
   1.102  
   1.103  
   1.104 -There are other useful configuration to go into $HOME/.hgrc,
   1.105 -e.g. defaults for common commands:
   1.106 +Here are some further examples for hgrc.  This is how to provide
   1.107 +default options for common commands:
   1.108  
   1.109    [defaults]
   1.110    log = -l 10
   1.111  
   1.112 -The next example shows how to install some Mercurial extension:
   1.113 +This is how to configure some extension, which is called "graphlog"
   1.114 +and provides the "glog" command:
   1.115  
   1.116    [extensions]
   1.117    hgext.graphlog =
   1.118  
   1.119 -Now the additional glog command will be available.
   1.120 -
   1.121 -
   1.122 -See also the fine documentation for further details, especially the
   1.123 -book http://hgbook.red-bean.com/
   1.124 -
   1.125 -There is also a nice tutorial at http://hginit.com/
   1.126 -
   1.127  
   1.128  Shared pull/push access
   1.129  -----------------------
   1.130  
   1.131  The entry point http://isabelle.in.tum.de/repos/isabelle is world
   1.132  readable, both via plain web browsing and the hg client as described
   1.133 -above.  Anybody can produce a clone, change it arbitrarily, and then
   1.134 -use regular mechanisms of Mercurial to report changes upstream, say
   1.135 -via e-mail to someone with write access to that file space.  It is
   1.136 -also quite easy to publish changed clones again on the web, using the
   1.137 -adhoc command "hg serve -v", or the hgweb.cgi or hgwebdir.cgi scripts
   1.138 -that are included in the Mercurial distribution.
   1.139 +above.  Anybody can produce a clone, change it locally, and then use
   1.140 +regular mechanisms of Mercurial to report changes upstream, say via
   1.141 +mail to someone with write access to that file space.  It is also
   1.142 +quite easy to publish changed clones again on the web, using the
   1.143 +ad-hoc command "hg serve -v", or the hgweb.cgi or hgwebdir.cgi scripts
   1.144 +that are included in the Mercurial distribution, and send a "pull
   1.145 +request" to someone else.  There are also public hosting services for
   1.146 +Mercurial repositories.
   1.147  
   1.148  The downstream/upstream mode of operation is quite common in the
   1.149  distributed version control community, and works well for occasional
   1.150  changes produced by anybody out there.  Of course, upstream
   1.151  maintainers need to review and moderate changes being proposed, before
   1.152 -pushing anything onto the official Isabelle repository at TUM.
   1.153 -
   1.154 +pushing anything onto the official Isabelle repository at TUM.  Direct
   1.155 +pushes are also reviewed routinely in a post-hoc fashion; everybody
   1.156 +hooked on the main repository is called to keep an eye on incoming
   1.157 +changes.  In any case, changesets need to be understandable, at the
   1.158 +time of writing and many years later.
   1.159  
   1.160 -Write access to the Isabelle repository requires an account at TUM,
   1.161 -with properly configured ssh access to the local machines
   1.162 -(e.g. macbroy20, atbroy100).  You also need to be a member of the
   1.163 -"isabelle" Unix group.
   1.164 +Push access to the Isabelle repository requires an account at TUM,
   1.165 +with properly configured ssh to the local machines (e.g. macbroy20,
   1.166 +atbroy100).  You also need to be a member of the "isabelle" Unix
   1.167 +group.
   1.168  
   1.169  Sharing a locally modified clone then works as follows, using your
   1.170  user name instead of "wenzelm":
   1.171 @@ -117,8 +123,8 @@
   1.172    hg push ssh://wenzelm@atbroy100//home/isabelle-repository/repos/isabelle
   1.173  
   1.174  
   1.175 -Default paths for push and pull can be configure in isabelle/.hg/hgrc,
   1.176 -for example:
   1.177 +Default paths for push and pull can be configured in
   1.178 +isabelle/.hg/hgrc, for example:
   1.179  
   1.180    [paths]
   1.181    default = ssh://wenzelm@atbroy100//home/isabelle-repository/repos/isabelle
   1.182 @@ -133,18 +139,17 @@
   1.183    hg clone ssh://wenzelm@atbroy100//home/isabelle-repository/repos/isabelle
   1.184  
   1.185  
   1.186 -Simplified merges
   1.187 ------------------
   1.188 +Simple merges
   1.189 +-------------
   1.190  
   1.191  The main idea of Mercurial is to let individual users produce
   1.192  independent branches of development first, but merge with others
   1.193  frequently.  The basic hg merge operation is more general than
   1.194  required for the mode of operation with a shared pull/push area.  The
   1.195 -hg fetch extension accommodates this case nicely, automating trivial
   1.196 +"fetch" extension accommodates this case nicely, automating trivial
   1.197  merges and requiring manual intervention for actual conflicts only.
   1.198  
   1.199 -The fetch extension can be configured via the user's ~/.hgrc like
   1.200 -this:
   1.201 +The fetch extension can be configured via $HOME/.hgrc like this:
   1.202  
   1.203    [extensions]
   1.204    hgext.fetch =
   1.205 @@ -152,68 +157,91 @@
   1.206    [defaults]
   1.207    fetch = -m "merged"
   1.208  
   1.209 -Note that the potential for merge conflicts can be greatly reduced by
   1.210 -doing "hg fetch" before any starting local changes!
   1.211 +To keep merges semantically trivial and prevent genuine merge
   1.212 +conflicts or lost updates, it is essential to observe to following
   1.213 +general discipline wrt. the public Isabelle push area:
   1.214 +
   1.215 +  * Before editing, pull or fetch the latest version.
   1.216 +
   1.217 +  * Accumulate private commits for a maximum of 1-3 days.
   1.218 +
   1.219 +  * Start publishing again by pull or fetch, which normally produces
   1.220 +    local merges.
   1.221 +
   1.222 +  * Test the merged result as usual and push back in real time.
   1.223 +
   1.224 +Piling private changes and public merges longer than 0.5-2 hours is
   1.225 +apt to produce some mess when pushing eventually!
   1.226  
   1.227  
   1.228  Content discipline
   1.229  ------------------
   1.230  
   1.231 -Old-style centralized version control is occasionally compared to "a
   1.232 -library where everybody scribbles into the books".  Or seen the other
   1.233 -way round, the centralized model discourages individual
   1.234 -experimentation (with local branches etc.), because everything is
   1.235 -forced to happen on a shared file space.  With Mercurial, arbitrary
   1.236 -variations on local clones are no problem, but care is required again
   1.237 -when publishing changes eventually.
   1.238 +The following principles should be kept in mind when producing
   1.239 +changesets that are meant to be published at some point.
   1.240  
   1.241 -The following principles should be kept in mind when producing
   1.242 -changesets that might become public at some point.
   1.243 -
   1.244 -  * The author of changes should be properly identified, using
   1.245 -    ui/username configuration as described above.
   1.246 +  * The author of changes needs to be properly identified, using
   1.247 +    [ui]username configuration as described above.
   1.248  
   1.249      While Mercurial also provides means for signed changesets, we want
   1.250      to keep things simple and trust that users specify their identity
   1.251 -    correctly.
   1.252 +    correctly (and uniquely).
   1.253  
   1.254    * The history of sources is an integral part of the sources
   1.255      themselves.  This means that private experiments and branches
   1.256 -    should not be published, unless they are really meant to become
   1.257 -    universally available.
   1.258 +    should not be published by accident.  Named branches are not
   1.259 +    allowed on the public version.  Note that old SVN-style branching
   1.260 +    is replaced by regular repository clones in Mercurial.
   1.261  
   1.262 -    Note that exchanging local experiments with some other users can
   1.263 -    be done directly on peer-to-peer basis, without affecting the
   1.264 -    central pull/push area.
   1.265 +    Exchanging local experiments with some other users can be done
   1.266 +    directly on peer-to-peer basis, without affecting the central
   1.267 +    pull/push area.
   1.268  
   1.269    * Log messages are an integral part of the history of sources.
   1.270 -    Other users will have to look there eventually, to understand why
   1.271 -    things have been done in a certain way at some point.
   1.272 +    Other people will have to inspect them routinely, to understand
   1.273 +    why things have been done in a certain way at some point.
   1.274 +
   1.275 +    Authors of log entries should be aware that published changes are
   1.276 +    actually read.  The main point is not to announce novelties, but
   1.277 +    to describe faithfully what has been done, and provide some clues
   1.278 +    about the motivation behind it.  The main recipient is someone who
   1.279 +    needs to understand the change in the distant future to isolate
   1.280 +    problems.  Sometimes it is helpful to reference past changes via
   1.281 +    changeset ids in the log entry.
   1.282  
   1.283 -    Mercurial provides nice web presentation of incoming changes with
   1.284 -    a digest of log entries; this also includes RSS/Atom news feeds.
   1.285 -    Users should be aware that others will actually read what is
   1.286 -    written into log messages.  There are also add-on browsers,
   1.287 -    notably hgtk that is part of the TortoiseHg distribution and works
   1.288 -    for generic Python/GTk platforms.
   1.289 +  * The standard changelog entry format of the Isabelle repository
   1.290 +    admits several (vaguely related) items to be rolled into one
   1.291 +    changeset.  Each item is then described on a separate line that
   1.292 +    may become longer as screen line and is terminated by punctuation.
   1.293 +    These lines are roughly ordered by importance.
   1.294  
   1.295 -    The usual changelog presentation style for the Isabelle repository
   1.296 -    admits log entries that consist of several lines, but without the
   1.297 -    special headline that is used in Mercurial projects elsewhere.
   1.298 -    Since some display styles strip newlines from text, it is
   1.299 -    advisable to separate lines via punctuation, and not rely on
   1.300 -    two-dimensional presentation too much.
   1.301 +    This format conforms to established Isabelle tradition.  In
   1.302 +    contrast, the default of Mercurial prefers a single headline
   1.303 +    followed by a long body text.  The reason for that is a somewhat
   1.304 +    different development model of typical "distributed" projects,
   1.305 +    where external changes pass through a hierarchy of reviewers and
   1.306 +    maintainers, until they end up in some authoritative repository.
   1.307 +    Isabelle changesets can be more spontaneous, growing from the
   1.308 +    bottom-up.
   1.309 +
   1.310 +    The web style of http://isabelle.in.tum.de/repos/isabelle/
   1.311 +    accommodates the Isabelle changelog format.  Note that multiple
   1.312 +    lines will sometimes display as a single paragraph in HTML, so
   1.313 +    some terminating punctuation is required.  Do not squeeze multiple
   1.314 +    items on the same line in the original text!
   1.315  
   1.316  
   1.317  Building a repository version of Isabelle
   1.318  -----------------------------------------
   1.319  
   1.320 -Compared to a proper distribution or development snapshot, a
   1.321 -repository version of Isabelle lacks textual version identifiers in
   1.322 -some sources and scripts, and various components produced by
   1.323 -Admin/build are missing.  After applying that script with suitable
   1.324 -arguments, the regular user instructions for building and running
   1.325 -Isabelle from sources apply.
   1.326 +Compared to a proper distribution or development snapshot, it is
   1.327 +relatively hard to build from the raw repository version.  Essential
   1.328 +contributing components are missing and need to be reconstructed by
   1.329 +running the Admin/build script by hand.  Afterwards the main Isabelle
   1.330 +system and logic images can be compiled via the toplevel ./build
   1.331 +script.  Note that the repository lacks some textual version
   1.332 +identifiers in the sources and scripts; this implies some changed
   1.333 +behavior when processing settings etc.
   1.334  
   1.335 -Needless to say, the results from the build process must not be added
   1.336 -to the repository!
   1.337 +There is no guarantee that the NEWS file is up to date at an arbitrary
   1.338 +point in history.
   1.339 \ No newline at end of file