File: git-github.html

package info (click to toggle)
openmpi 5.0.8-4
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 201,684 kB
  • sloc: ansic: 613,078; makefile: 42,353; sh: 11,194; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,179; python: 1,859; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (338 lines) | stat: -rw-r--r-- 22,187 bytes parent folder | download | duplicates (3)
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<!DOCTYPE html>
<html class="writer-html5" lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>13.2. GitHub, Git, and related topics &mdash; Open MPI 5.0.8 documentation</title>
      <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
      <link rel="stylesheet" type="text/css" href="../_static/css/theme.css" />

  
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/sphinx_highlight.js"></script>
    <script src="../_static/js/theme.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="13.3. Compiler Pickyness by Default" href="compiler-pickyness.html" />
    <link rel="prev" title="13.1. Prerequisites" href="prerequisites.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="../index.html" class="icon icon-home">
            Open MPI
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../quickstart.html">1. Quick start</a></li>
<li class="toctree-l1"><a class="reference internal" href="../getting-help.html">2. Getting help</a></li>
<li class="toctree-l1"><a class="reference internal" href="../release-notes/index.html">3. Release notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../installing-open-mpi/index.html">4. Building and installing Open MPI</a></li>
<li class="toctree-l1"><a class="reference internal" href="../features/index.html">5. Open MPI-specific features</a></li>
<li class="toctree-l1"><a class="reference internal" href="../validate.html">6. Validating your installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../version-numbering.html">7. Version numbers and compatibility</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mca.html">8. The Modular Component Architecture (MCA)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../building-apps/index.html">9. Building MPI applications</a></li>
<li class="toctree-l1"><a class="reference internal" href="../launching-apps/index.html">10. Launching MPI applications</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tuning-apps/index.html">11. Run-time operation and tuning MPI applications</a></li>
<li class="toctree-l1"><a class="reference internal" href="../app-debug/index.html">12. Debugging Open MPI Parallel Applications</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">13. Developer’s guide</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="prerequisites.html">13.1. Prerequisites</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">13.2. GitHub, Git, and related topics</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#github">13.2.1. GitHub</a></li>
<li class="toctree-l3"><a class="reference internal" href="#git-commits-open-source-contributor-s-declaration">13.2.2. Git commits: open source / contributor’s declaration</a></li>
<li class="toctree-l3"><a class="reference internal" href="#git-branch-scheme">13.2.3. Git branch scheme</a></li>
<li class="toctree-l3"><a class="reference internal" href="#ci-testing">13.2.4. CI (testing)</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="compiler-pickyness.html">13.3. Compiler Pickyness by Default</a></li>
<li class="toctree-l2"><a class="reference internal" href="autogen.html">13.4. Running <code class="docutils literal notranslate"><span class="pre">autogen.pl</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="building-open-mpi.html">13.5. Building Open MPI</a></li>
<li class="toctree-l2"><a class="reference internal" href="terminology.html">13.6. Open MPI terminology</a></li>
<li class="toctree-l2"><a class="reference internal" href="source-code.html">13.7. Source code</a></li>
<li class="toctree-l2"><a class="reference internal" href="frameworks.html">13.8. Internal frameworks</a></li>
<li class="toctree-l2"><a class="reference internal" href="gnu-autotools.html">13.9. Manually installing the GNU Autootools</a></li>
<li class="toctree-l2"><a class="reference internal" href="sphinx.html">13.10. Installing and running Sphinx (building the Open MPI docs)</a></li>
<li class="toctree-l2"><a class="reference internal" href="rst-for-markdown-expats.html">13.11. ReStructured Text for those who know Markdown</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">14. Contributing to Open MPI</a></li>
<li class="toctree-l1"><a class="reference internal" href="../license/index.html">15. License</a></li>
<li class="toctree-l1"><a class="reference internal" href="../history.html">16. History of Open MPI</a></li>
<li class="toctree-l1"><a class="reference internal" href="../man-openmpi/index.html">17. Open MPI manual pages</a></li>
<li class="toctree-l1"><a class="reference internal" href="../man-openshmem/index.html">18. OpenSHMEM manual pages</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">Open MPI</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="index.html"><span class="section-number">13. </span>Developer’s guide</a></li>
      <li class="breadcrumb-item active"><span class="section-number">13.2. </span>GitHub, Git, and related topics</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../_sources/developers/git-github.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <style>
.wy-table-responsive table td,.wy-table-responsive table th{white-space:normal}
</style><div class="section" id="github-git-and-related-topics">
<h1><span class="section-number">13.2. </span>GitHub, Git, and related topics<a class="headerlink" href="#github-git-and-related-topics" title="Permalink to this heading"></a></h1>
<div class="section" id="github">
<h2><span class="section-number">13.2.1. </span>GitHub<a class="headerlink" href="#github" title="Permalink to this heading"></a></h2>
<p>Open MPI’s Git repositories are <a class="reference external" href="https://github.com/open-mpi/ompi">hosted at GitHub</a>.</p>
<ol class="arabic">
<li><p>First, you will need a Git client. We recommend getting the latest
version available. If you do not have the command <code class="docutils literal notranslate"><span class="pre">git</span></code> in your
path, you will likely need to download and install Git.</p></li>
<li><p><a class="reference external" href="https://github.com/open-mpi/ompi/">ompi</a> is the main Open MPI
repository where most active development is done.  Git clone this
repository.  Note that the use of the <code class="docutils literal notranslate"><span class="pre">--recursive</span></code> CLI option is
necessary because Open MPI uses Git submodules:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>shell$ git clone --recursive https://github.com/open-mpi/ompi.git
</pre></div>
</div>
</li>
</ol>
<p>Note that Git is natively capable of using many forms of web
proxies. If your network setup requires the user of a web proxy,
<a class="reference external" href="https://git-scm.com/">consult the Git documentation for more details</a>.</p>
</div>
<div class="section" id="git-commits-open-source-contributor-s-declaration">
<h2><span class="section-number">13.2.2. </span>Git commits: open source / contributor’s declaration<a class="headerlink" href="#git-commits-open-source-contributor-s-declaration" title="Permalink to this heading"></a></h2>
<p>In order to remain open source, all new commits to the Open MPI
repository must include a <code class="docutils literal notranslate"><span class="pre">Signed-off-by:</span></code> line, indicating the
submitter’s agreement to the <a class="reference internal" href="../contributing.html#contributing-contributors-declaration-label"><span class="std std-ref">Open MPI Contributor’s Declaration</span></a>.</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>You can use the <code class="docutils literal notranslate"><span class="pre">-s</span></code> option to <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">commit</span></code> to
automatically add the <code class="docutils literal notranslate"><span class="pre">Signed-off-by:</span></code> line to your commit
message.</p>
</div>
</div>
<div class="section" id="git-branch-scheme">
<span id="git-github-branch-scheme-label"></span><h2><span class="section-number">13.2.3. </span>Git branch scheme<a class="headerlink" href="#git-branch-scheme" title="Permalink to this heading"></a></h2>
<p>Generally, Open MPI has two types of branches in its Git repository:</p>
<ol class="arabic simple">
<li><p><code class="docutils literal notranslate"><span class="pre">main</span></code>:</p>
<ul class="simple">
<li><p>All active development occurs on the <code class="docutils literal notranslate"><span class="pre">main</span></code> branch (new features,
bug fixes, etc.).</p></li>
</ul>
</li>
<li><p>Release branches of the form <code class="docutils literal notranslate"><span class="pre">vMAJOR.MINOR.x</span></code> (e.g., <code class="docutils literal notranslate"><span class="pre">v4.0.x</span></code>,
<code class="docutils literal notranslate"><span class="pre">v4.1.x</span></code>, <code class="docutils literal notranslate"><span class="pre">v5.0.x</span></code>).</p>
<ul class="simple">
<li><p>The <code class="docutils literal notranslate"><span class="pre">.x</span></code> suffix indicates that this branch is used to create
all releases in the Open MPI vMAJOR.MINOR series.</p></li>
<li><p>Periodically, the Open MPI community will make a new release
branch, typically from <code class="docutils literal notranslate"><span class="pre">main</span></code>.</p></li>
<li><p>A Git tag of the form <code class="docutils literal notranslate"><span class="pre">vMAJOR.MINOR.RELEASE</span></code> is used to
indicate the specific commit on a release branch from where
official Open MPI release tarball was created (e.g., <code class="docutils literal notranslate"><span class="pre">v4.1.0</span></code>,
<code class="docutils literal notranslate"><span class="pre">v4.1.1</span></code>, <code class="docutils literal notranslate"><span class="pre">v4.1.2</span></code>, etc.).</p></li>
</ul>
</li>
</ol>
<p>Once a bug is fixed or a new feature is implemented on <code class="docutils literal notranslate"><span class="pre">main</span></code>, it is
cherry-picked over to the relevant release branch(es).</p>
<div class="admonition attention">
<p class="admonition-title">Attention</p>
<p>It may seem odd to some, but the Open MPI community
development model does <em>not</em> PR bug fixes or new
features directly to release branches.  Instead,
initial bug-fix / feature PRs are generally first made
to <code class="docutils literal notranslate"><span class="pre">main</span></code>.</p>
<p>This helps us ensure that future releases (with
<code class="docutils literal notranslate"><span class="pre">main</span></code> as a Git ancestor) will contain the bug fix /
feature.</p>
</div>
<p>For example:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>shell$<span class="w"> </span>git<span class="w"> </span>checkout<span class="w"> </span>main
shell$<span class="w"> </span>git<span class="w"> </span>pull<span class="w"> </span>--rebase
shell$<span class="w"> </span>git<span class="w"> </span>checkout<span class="w"> </span>pr/bug-fix

<span class="c1"># ... make changes / fix a bug / etc. ...</span>

shell$<span class="w"> </span>git<span class="w"> </span>add<span class="w"> </span>...
shell$<span class="w"> </span>git<span class="w"> </span>commit<span class="w"> </span>-s<span class="w"> </span>...
shell$<span class="w"> </span>git<span class="w"> </span>push<span class="w"> </span>myfork
</pre></div>
</div>
<p>At this point, you go create a PR from your fork’s <code class="docutils literal notranslate"><span class="pre">pr/bug-fix</span></code>
branch to the Open MPI community GitHub repo <code class="docutils literal notranslate"><span class="pre">main</span></code> branch.  Work
with the community to get the PR completed and merged.  Then you can
open a new PR to cherry pick the Git commits from that bug fix to each
of the relevant release branches.</p>
<p>Depending on how far the release branch has diverged from <code class="docutils literal notranslate"><span class="pre">main</span></code>,
there may be some porting effort involved in the cherry-pick.</p>
<p>For example, if your bug fix on <code class="docutils literal notranslate"><span class="pre">main</span></code> is comprised of a single Git
commit hash <code class="docutils literal notranslate"><span class="pre">123abc</span></code>:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># Fetch all upstream git activity, including the merge of the &quot;main&quot; PR.</span>
shell$<span class="w"> </span>get<span class="w"> </span>fetch<span class="w"> </span>--all

<span class="c1"># Check out the target release branch, and advance to the most recent commit.</span>
shell$<span class="w"> </span>git<span class="w"> </span>checkout<span class="w"> </span>v5.0.x
shell$<span class="w"> </span>git<span class="w"> </span>pull<span class="w"> </span>--rebase

<span class="c1"># Make a branch for your bug fix</span>
shell$<span class="w"> </span>git<span class="w"> </span>checkout<span class="w"> </span>-b<span class="w"> </span>pr/v5.0.x/bug-fix
<span class="c1"># Cherry pick the commit from the &quot;main&quot; branch</span>
shell$<span class="w"> </span>git<span class="w"> </span>cherry-pick<span class="w"> </span>-x<span class="w"> </span>123abc
<span class="c1"># Push to your fork</span>
shell$<span class="w"> </span>git<span class="w"> </span>push<span class="w"> </span>myfork
</pre></div>
</div>
<p>The Open MPI development community <em>requires</em> adding the following
line to the commit message of cherry-picked commits on release
branches:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>(cherry picked from commit [git_hash_of_original_commit])
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Note the use of the <code class="docutils literal notranslate"><span class="pre">-x</span></code> option to <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">cherry-pick</span></code>.
This option automatically adds the <code class="docutils literal notranslate"><span class="pre">(cherry</span> <span class="pre">picked</span> <span class="pre">from</span>
<span class="pre">...)</span></code> line to your commit message.</p>
</div>
<div class="tip admonition">
<p class="admonition-title">Rationale</p>
<p>Git does not actually store any meta data about Git cherry-picks in
the commit.  Having a standardized text line containing the source
Git commit hash in the commit messages helps the Open MPI
development community track where commits came from on release
branches, and therefore allows us to check whether all relevant
commits have been ported to a given release branch.</p>
</div>
<p>Once your commits are ready and pushed up to your fork, make a PR to
the target release branch.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>A GitHub PR CI job checks all commits on release branches
for the <code class="docutils literal notranslate"><span class="pre">(cherry</span> <span class="pre">picked</span> <span class="pre">from...)</span></code> line. It will also
ensure that the Git hash cited in that line actually
exists on the <code class="docutils literal notranslate"><span class="pre">main</span></code> branch.</p>
<p>This check ensures that commits are not made to release
branches before their corresponding <code class="docutils literal notranslate"><span class="pre">main</span></code> PR was
merged.</p>
</div>
<p>All this being said, sometimes there is a need for a non-cherry-picked
commit on a release branch. E.g., sometimes a release branch has
diverged so much that the bug no longer exists on <code class="docutils literal notranslate"><span class="pre">main</span></code>.  It would
therefore not make sense — or even be impossible — to
commit the bug fix in question to <code class="docutils literal notranslate"><span class="pre">main</span></code>.</p>
<p>In such cases, make a regular PR to the target branch (with commits
that do <em>not</em> include <code class="docutils literal notranslate"><span class="pre">(cherry</span> <span class="pre">picked</span> <span class="pre">from</span> <span class="pre">...)</span></code> lines).  In the PR
description, add a line with the following token:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>bot:notacherrypick
</pre></div>
</div>
<p>This tells the GitHub CI job that this PR contains commits that are
not cherry-picked from <code class="docutils literal notranslate"><span class="pre">main</span></code>.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p><code class="docutils literal notranslate"><span class="pre">bot:notacherrypick</span></code> should only be used when
absolutely necessary.  It is not a license to avoid
the process of PR’ing to <code class="docutils literal notranslate"><span class="pre">main</span></code> first.</p>
</div>
</div>
<div class="section" id="ci-testing">
<h2><span class="section-number">13.2.4. </span>CI (testing)<a class="headerlink" href="#ci-testing" title="Permalink to this heading"></a></h2>
<p>The Open MPI community generally runs two flavors of testing:</p>
<ol class="arabic simple">
<li><p>A bunch of tests on each PR (Continuous Integration / CI).  These
tests are a mixture of GitHub Actions and other CI systems (e.g.,
Jenkins).  Examples include (but are not limited to):</p>
<ul class="simple">
<li><p>Check each Git commit for bozo email addresses</p></li>
<li><p>Check that each Git commit contains a <code class="docutils literal notranslate"><span class="pre">Signed-off-by</span></code> line</p></li>
<li><p>Check that commits on release branches contain a cherry-pick
notice</p></li>
<li><p>Build and publish the docs</p></li>
<li><p>Build Open MPI in a variety of environments and run sanity tests
with that installation</p></li>
</ul>
</li>
<li><p>Daily testing via the MPI Testing Tool (MTT).</p>
<ul class="simple">
<li><p>These are generally tests that take much longer to run than on a
per-PR basis.  <a class="reference external" href="https://www.open-mpi.org/nightly/">A “nightly snapshot” tarball</a> is created for <code class="docutils literal notranslate"><span class="pre">main</span></code> and
each relevant release branch.</p></li>
<li><p>MTT tests are run with this snapshot tarball so that all
organizations are testing with the same snapshots.</p></li>
<li><p><a class="reference external" href="https://mtt.open-mpi.org/">Results are available here</a>.</p></li>
</ul>
</li>
</ol>
</div>
</div>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="prerequisites.html" class="btn btn-neutral float-left" title="13.1. Prerequisites" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="compiler-pickyness.html" class="btn btn-neutral float-right" title="13.3. Compiler Pickyness by Default" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2003-2025, The Open MPI Community.
      <span class="lastupdated">Last updated on 2025-05-30 16:41:43 UTC.
      </span></p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>