Using Mercurial, evolve and hg-git in an academic context

User experience in a particular context: academic

  • Using versioning for research/teaching
  • Versioning for the dummies
  • Teaching versioning

Context: who I am?

  • CNRS researcher, fluid mechanics, turbulence & instabilities. Experiments and simulations.

  • A lot of software development (open-source, Python). Unlike most of my colleagues…

Context: me and Mercurial

  • Learned Mercurial in 2014 because (i) I read that it was easier than Git yet powerfull and (ii) Python…

  • Stayed with Mercurial because my first experiences with Git weren’t so pleasant.

  • Bitbucket user before 2020, then adopted Heptapod.

  • hg-git user to interact with Git repos on Github and Gitlab.

  • Teach hg and hg-git to post-docs/PhDs and also students

In my group, version control used for

  • Software development

  • Scientific communications (articles, presentations, notes) and few websites…

Note: Dropbox like services (Owncloud and Nextcloud) to build/share datasets.

In my group, different workflows

  • With Heptapod:

    • topic based workflow with 1 branch and Github mirroring for visibility and for some services, like Github Actions

    • Simple 1 branch workflow without Merge Request

  • With Github / Gitlab (hg-git):

    • Bookmark based workflow with and without fork

    • Simple 1 branch workflow without Pull Request

Observations about workflows (1)

  • Topic based workflow with Heptapod is great, especially to collaborate with beginners/students

    1. Experienced users can edit the history in MR (for ex. rebase, fold, split, …)

    2. Beginners learn not being afraid of hg commit (something wrong can be amend or prune)

    3. Experienced users can explained what can be done (for ex. absorb)

  • No fork is actually often a good thing for us

Observations about workflows (2)

  • Unnamed branches could simplify things for beginners. They could push and a more experienced users can merge.

  • Topics much nicer than bookmarks. But we still need to learn/use both!

Is it worth it for scientists? Versioning, DevOps platforms and hg?

Advantages explicit versioning

  • remote saving
  • working on different computers
  • collaboration
  • CI, Merge requests, …

Evident for programming, less for other activities…

  • Should command line based versioning tools be used by academics for text edition (for ex. Latex)?

    Some people prefer more integrated tools (for example Overleaf, Dropbox, layers between Git and the users…).

Explicit versioning useful as long as a bit of programming

Which tool for people not specialized in development but who could benefit from versioning?

Git or Mercurial?

Advantages of Mercurial over Git?

  • Better user interface / simpler (???)
  • No Git index
  • Phases (security/simplicity from the client)
  • evolve (collaborative and secure history rewriting)
  • No need of --force
  • Git branches are “only” like bookmarks

Disadvantages of Mercurial compared to Git

  • Incompatible with many tools in a world where for most people “version control” is Git.

  • Nothing like Github for Mercurial (mass, Github Actions, bots, integration with other tools, …)

  • Harder to get (git is “everywhere” and no extension)

Is it worth it for scientists? Versioning, DevOps platforms and hg?

For communities in which people who are not developers need to program and share code, explicit versioning with Mercurial still make sense.

Thus a “Mercurial for dummies” plan is interesting…

Propose Mercurial as a good solution for people not specialized in development but who could benefit from versioning.

Note: an alternative to the current situation: “Git for dummies”

Github cannot be fully avoided

  • Github is so widely used. Scientists need to be able to interact with projects on Github.

  • Only questions: Which client? Command line based? Git? Or Mercurial with hg-git as an alternative Git client?

  • Most scientists do not have time/energy to learn two version control tools!

“hg for dummies” plan: issues

The plan:

Propose Mercurial as a good solution for people not specialized in development but who could benefit from versioning.

  • Heptapod instances

  • hg-git

Nearly good… But some serious issues…

Note: Situation already much better than few years ago!

“hg for dummies” plan: issues (1)


Installation and configuration

  • Not easy to install/setup Mercurial with hg-git + hg-evolve (compared to Git).

  • Setup a good Mercurial environment on Windows? See Git Bash

  • Configuration (slightly harder than with Git git config --global user.name "Mona Lisa")

“hg for dummies” plan: issues (2)


Documentation (hg and hg-git)

  • on the web: often quite outdated contents (Mercurial book, wiki, Stackoverflow)…

  • in the terminal: not easily searchable, lack a good doc reader application (Textual could be great!)

“hg for dummies” plan: issues (3)


Heptapod

  • University Gitlab instances are not running Heptapod

  • Topic: after a merge on Heptapod, hg pull; hg up; hg up; hg topic new-topic-name

“hg for dummies” plan: issues (4)


hg-git

  • Bookmark based hg-git workflow less nice than topic based workflow

  • Users need to learn topics and bookmarks 🙁

  • Incompatible tools (for example setuptools-scm, MyBender, precommit…).

“hg for dummies” plan: small ideas

Can’t wait improvements in core Mercurial…

  • conda-forge: conda-app install mercurial

  • An updated version of the Mercurial book: https://foss.heptapod.net/mercurial/mercurial-jupyterbook

  • Python package to help installing hg extensions and editing config

  • Python package (based on Textual) to navigate and search in Mercurial documentation

Conclusions

  • Mercurial/hg-git/Heptapod are already great tools for us. Thanks a lot to the mainteners!

  • The “Mercurial for dummies” plan is fun

    • It would require some care

    • It could bring future users and visibility