summaryrefslogtreecommitdiffstats
path: root/mobile/android/docs/geckoview/contributor/mc-quick-start.rst
blob: bac9dc3ce5306ee1d53a8f2063651e215949e41a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
.. -*- Mode: rst; fill-column: 80; -*-

===========================
Mozilla Central Quick Start
===========================

Table of contents
=================

.. contents:: :local:

Firefox Developer Git Quick Start Guide
=======================================

Getting setup to as a first time Mozilla contributor is hard. There are
plenty of guides out there to help you get started as a contributor, but
many of the new contributor guides out of date often more current ones
are aimed at more experienced contributors. If you want to review these
guides, you can find several linked to from
:ref:`Working on Firefox <Working on Firefox>`.

This guide will take you through setting up as a contributor to
``mozilla-central``, the Firefox main repository, as a git user.

Setup
-----

The first thing you will need is to install Mercurial as this is the VCS
that ``mozilla-central`` uses.

.. _mac-0:

Mac
~~~

.. _homebrew-0:

Homebrew
^^^^^^^^

.. code:: bash

   brew install mercurial

macports
^^^^^^^^

.. code:: bash

   sudo port install mercurial

Linux
~~~~~

apt
^^^

.. code:: bash

   sudo apt-get install mercurial

Alternatively you can install `Mercurial directly <https://www.mercurial-scm.org/wiki/Download>`_.

Check that you have successfully installed Mercurial by running:

.. code:: bash

   hg --version

If you are an experienced git user and are unfamiliar with Mercurial,
you may want to install ``git-cinnabar``. Cinnabar is a git remote
helper that allows you to interact with Mercurial repos using git
semantics.

git-cinnabar
------------

There is a Homebrew install option for ``git-cinnabar``, but this did
not work for me, nor did the installer option. Using these tools, when I
tried to clone the Mercurial repo it hung and did not complete. I had to
do a manual install before I could use ``git-cinnabar`` successfully to
download a Mercurial repo. If you would like to try either of these
option, however, here they are:

.. _mac-1:

Mac
~~~~~

.. _homebrew-1:

Homebrew
^^^^^^^^

.. code:: bash

   brew install git-cinnabar

All Platforms
~~~~~~~~~~~~~

Installer
^^^^^^^^^

.. code:: bash

   git cinnabar download

Manual installation
^^^^^^^^^^^^^^^^^^^

.. code:: bash

   git clone https://github.com/glandium/git-cinnabar.git && cd git-cinnabar
   make
   export PATH="$PATH:/somewhere/git-cinnabar"
   echo 'export PATH="$PATH:/somewhere/git-cinnabar"' >> ~/.bash_profile
   git cinnabar download

``git-cinnabar``\ ’s creator, `glandium <https://glandium.org/>`_, has
written a number of posts about setting up for Firefox Development with
git. This `post <https://glandium.org/blog/?page_id=3438>`_ is the one
that has formed the basis for this walkthrough.

In synopsis:

-  initialize an empty git repository

.. code:: bash

   git init gecko && cd gecko

-  Configure git:

.. code:: bash

   git config fetch.prune true
   git config push.default upstream

-  Add remotes for your repositories. There are several to choose from,
   ``central``, ``inbound``, ``beta``, ``release`` etc. but in reality,
   if you plan on using Phabricator, which is Firefox’s preferred patch
   submission system, you only need to set up ``central``. It might be
   advisable to have access to ``inbound`` however, if you want to work
   on a version of Firefox that is queued for release. This guide will
   be focused on Phabricator.

.. code:: bash

   git remote add central hg::https://hg.mozilla.org/mozilla-central -t branches/default/tip
   git remote add inbound hg::https://hg.mozilla.org/integration/mozilla-inbound -t branches/default/tip
   git remote set-url --push central hg::ssh://hg.mozilla.org/mozilla-central
   git remote set-url --push inbound hg::ssh://hg.mozilla.org/integration/mozilla-inbound

-  Expose the branch tip to get quick access with some easy names.

.. code:: bash

   git config remote.central.fetch +refs/heads/branches/default/tip:refs/remotes/central/default
   git config remote.inbound.fetch +refs/heads/branches/default/tip:refs/remotes/inbound/default

-  Setup a remote for the try server. The try server is an easy way to
   test a patch without actually checking the patch into the core
   repository. Your code will go through the same tests as a
   ``mozilla-central`` push, and you’ll be able to download builds if
   you wish.

.. code:: bash

   git remote add try hg::https://hg.mozilla.org/try
   git config remote.try.skipDefaultUpdate true
   git remote set-url --push try hg::ssh://hg.mozilla.org/try
   git config remote.try.push +HEAD:refs/heads/branches/default/tip

-  Now update all the remotes. This performs a ``git fetch`` on all the
   remotes. Mozilla Central is a *large* repository. Be prepared for
   this to take a very long time.

.. code:: bash

   git remote update

All that’s left to do now is pick a bug to fix and `submit a
patch <contributing-to-mc.html>`__.