SCM/HGtoGit: Difference between revisions

From MozillaWiki
< SCM
Jump to navigation Jump to search
m (Bug 1082602)
(Replaced content with "(Old content removed)")
 
Line 1: Line 1:
=Migrating from Hg to Git/Github=
(Old content removed)
In discussing a migration from Mercurial (Hg) to Git, there are really two issues to address:
# migration from Hg to Git
# migration from Mozilla hosted to third party hosted (Github) repositories
 
This page summarizes the benefits, issues, and requirements for both #1 and #2. The material is flagged by role to allow people to easily view the information relevant to them.
 
There are three primary roles that make use of Mozilla's source code management (SCM) systems: developers {{devs}}, release engineers {{releng}}, and IT system admins {{IT}}.
 
==Migration from Hg to Git==
===Benefits===
* Simplified onboarding for new contributors as Git is better known today than Hg {{devs}}
* Git supports new workflows not supported by Hg {{devs}}
* <strike>Git lets developers have a single repository (and multiple checkouts if so desired) for m-c, aurora, beta, etc, work {{devs}}</strike>
** This is doable with the [http://mercurial.selenic.com/wiki/ShareExtension share extension]. See https://bitbucket.org/indygreg/gecko/ for a unified Mercurial repository.
* Better merging algorithm, fewer conflicts {{devs}}
* <strike>Easier source code archeology, we'll have history since the dawn of time (i.e. all of Hg and CVS) {{devs}}</strike>
** This is doable with Mercurial. We'd need a flag day. But we could do it if we wanted.
* Git performs better than Hg (modulo in some operations on Windows, which we're working on) {{devs}}
* <strike>Hg occasionally corrupts repositories (known bug, wontfix), no such known issues with Git {{devs}} {{releng}}</strike>
** Modern versions of Mercurial don't corrupt repositories with nearly the same frequency as older versions. If you are referring to {{bug|737865}}, this is because Mozilla is hosting Mercurial over NFS, which is not recommended.
* Mozilla currently makes use of Hg and Git, consolidation is easier for all devs {{devs}}
* <strike>Better review tools (Gerrit) available for devs {{devs}}</strike>
** Most review tools are built on the concept of *take a patch against a parent revision* and this concept works equally well with Mercurial and Git. ReviewBoard, Rietveld, and Phabricator all support Mercurial and Git.
* Simplified debugging (no longer have to debug Hg) {{releng}} {{IT}}
** You are just swapping Mercurial for Git.
* <strike>Simplified management as only one SCM system {{releng}} {{IT}}</strike>
** IT will still manage hg.mozilla.org as not every project will switch to Git.
 
===Issues===
* Overhead in having a large number of people learn new tools {{devs}}
* [http://msysgit.github.com/ Git for Windows] performance (per above) compared to Hg {{devs}}
* IT team has limited experience with Git at this point {{IT}}
* git.m.o has had limited usage, need to review and stress test to ensure deployment can support scale {{IT}}
* Cost to releng to update build and related tools {{releng}}
 
===Requirements===
* Update build tools (Windows tools specifically) to support Git {{devs}}
** jlebar's tools https://github.com/jlebar/moz-git-tools
* Must be able to create user repos as can do on Hg {{devs}}
* [https://hg.mozilla.org/hgcustom/pushlog/ Pushlog] equivalent needs to be created for Git {{devs}} {{releng}}
* [https://hg.mozilla.org/hgcustom/hghooks/file/93dc9c506add/mozhghooks Repository hooks] {{releng}}
**tree closure
**approval required hook
**try syntax
**l10n change protector for aurora + beta (not yet implemented - see {{bug|859358}})
* Update for Nightly about:buildconfig to link to Git revision {{releng}}
* Bugzilla must be updated to links to Git change sets, existing Hg links must not break {{devs}}
* [https://treeherder.mozilla.org treeherder.mozilla.org] (links to changeset id) must be updated to support Git or an equivalent system put in place {{devs}} {{releng}}
* [https://crash-stats.mozilla.com crash-stats] must be updated to support Git {{devs}}
* l10n tooling must be updated to support Git
* Will need to scale Git infrastructure (currently 2 machines) but should be able to reuse Hg machines {{IT}}
* Replacements for third party tools currently in use by dev community
** Dave Townsend's [http://hgchanges.fractalbrew.com/ HG Change Feed] ([https://github.com/Mossop/hgchangefeed source])
 
==Moving from Mozilla hosted to third party (Github) hosted==
===Benefits===
* Easier onboarding/discoverability for community {{devs}}
* Nice change review system {{devs}}
 
===Issues===
* Security of repo on hosted provider (can we trust our code to live there?) {{releng}} {{IT}}
* Up-time of hosted repos (Mozilla up-time is very good, have had sync problems with GitHub repos) {{releng}}
* Latency and failed pulls, some builds must pull from ~30 repos {{releng}}
* Some teams (NSS, security) require internal hosting {{devs}} {{IT}}
* Stability of repo / long term viability {{devs}} {{releng}} {{IT}}
* Github issues cause confusion as work is tracked in Bugzilla (can issues be disabled?) {{devs}}
* No pre-commit hooks, only post-commit hooks {{releng}}
** no ability to block code commits, only react to bad commits
* Limited ability to add new features
 
===Requirements===
* Must be able to back out changes without leaving history {{releng}}
* Must have ability to duplicate current repository hooks (see requirements) functionality {{releng}}
 
==References==
* [https://etherpad.mozilla.org/value-of-github Value of GitHub etherpad]
* gps blog post: [http://gregoryszorc.com/blog/2013/05/12/thoughts-on-mercurial-(and-git) Thoughts on Mercurial (and Git)]
* gps blog post: [http://gregoryszorc.com/blog/2013/05/13/the-state-of-mercurial-at-mozilla The State of Mercurial at Mozilla]

Latest revision as of 16:10, 7 November 2023

(Old content removed)