-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsplit-repositories.html
231 lines (207 loc) · 11.5 KB
/
split-repositories.html
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
<!DOCTYPE html>
<!--[if IE 8]>
<html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en"> <!--<![endif]-->
<head><base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="assets/css/theme.css" type="text/css" />
<link rel="stylesheet" href="assets/css/highlightjs.css" type="text/css" />
<link rel="stylesheet" href="assets/css/badge_only.css" type="text/css" />
</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">
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<div class="wy-nav-content"> <div class="rst-content">
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody">
<div class="section">
<h1 id="managing-split-repositories">
Managing Split Repositories
<a class="headerlink" href="#managing-split-repositories" title="Permalink to this headline">¶</a>
</h1>
<p>A special feature of HuPKit is the ability to handle monolith project developments,
instead of having separate Git repositories for each package, all are housed in a
central repository from where all work is coordinated.</p>
<div class="admonition admonition-note ">
<p class="admonition-title">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="24" height="24" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg>
<span>Note</span>
</p><p>Before you continue make sure <a href="https://github.com/splitsh/lite" class="reference external" rel="external noopener noreferrer" target="_blank">splitsh-lite</a> is installed and can be
found in your <code translate="no" class="notranslate">PATH</code> environment (no shell alias!).</p>
</div>
<div class="section">
<h2 id="configuration">
Configuration
<a class="headerlink" href="#configuration" title="Permalink to this headline">¶</a>
</h2>
<p>To make this "repository splitting" work, a number of targets must be configured.
Each target consists of a prefix (directory path), target repository and some
additional options like if tag-synchronizing is enabled.</p>
<div class="admonition admonition-tip ">
<p class="admonition-title">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="24" height="24" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" /></svg>
<span>Tip</span>
</p><p>Suffice to say, the split target repositories must exist!</p>
<p>They are not created automatically, but you can use the <code translate="no" class="notranslate">split-create</code>
command to create the repositories, any already existing ones are ignored,
missing ones created.</p>
</div>
<p>See <a href="config.html#splitting-config" class="reference internal">Repository splitting configuration</a>, how to
configure your splits.</p>
<p>To test if the configuration is correct run the <code translate="no" class="notranslate">split-repo --dry-run</code>
command to see what would have happened.</p>
<p>Everything correct? Then run the <code translate="no" class="notranslate">split-repo</code> command.</p>
<div class="admonition admonition-note ">
<p class="admonition-title">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="24" height="24" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg>
<span>Note</span>
</p><p>Depending on the total amount of commits, split targets, and your
internet speed, this process might take some time to complete.</p>
</div>
</div>
<div class="section">
<h2 id="splitting-after-a-pull-request-merge">
Splitting After a Pull Request Merge
<a class="headerlink" href="#splitting-after-a-pull-request-merge" title="Permalink to this headline">¶</a>
</h2>
<p>Once the repository splitting is configured, you want to make sure the
split repositories are up-to-date.</p>
<p>You can either run the <code translate="no" class="notranslate">split-repo</code> command at any time, or split
the repository after you <a href="commands/merge.html" class="reference internal">merge a pull request</a>,
this process may take some time depending of number of commits and targets.</p>
<div class="admonition admonition-tip ">
<p class="admonition-title">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="24" height="24" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" /></svg>
<span>Tip</span>
</p><p>If you need to merge more than one pull-request you'd properly want
to hold-of the split operation until you're done.</p>
<p>Use <code translate="no" class="notranslate">no-split</code> command option to skip the splitting, or set the
<code translate="no" class="notranslate">pull_request.split</code> repository configuration to <code translate="no" class="notranslate">none</code>.</p>
</div>
<div class="admonition admonition-caution ">
<p class="admonition-title">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="24" height="24" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
<span>Caution</span>
</p><p>Splitting is automatically skipped when the <code translate="no" class="notranslate">--no-pull</code> command option
is provided.</p>
</div>
</div>
<div class="section">
<h2 id="splitting-with-a-release">
Splitting With a Release
<a class="headerlink" href="#splitting-with-a-release" title="Permalink to this headline">¶</a>
</h2>
<p>The <code translate="no" class="notranslate">release</code> command works a little different here. When making a new release the
split operation is always performed! You cannot skip this. However you can skip
the synchronizing of tags for certain split repositories by setting the <code translate="no" class="notranslate">sync-tags</code>
config to false.</p>
<div translate="no" class="highlight-php notranslate">
<table class="highlighttable">
<tbody>
<tr>
<td class="linenos">
<div class="linenodiv">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13</pre>
</div>
</td>
<td class="code">
<div class="highlight">
<pre class="hljs php"><span class="hljs-keyword">return</span> [
<span class="hljs-string">'branches'</span> => [
<span class="hljs-string">':default'</span> => [
<span class="hljs-string">'sync-tags'</span> => <span class="hljs-keyword">true</span>, <span class="hljs-comment">// disable for all (or...)</span>
<span class="hljs-string">'split'</span> => [
<span class="hljs-comment">// Disable/enable per repository target</span>
<span class="hljs-string">'src/Bundle/CoreBundle'</span> => [<span class="hljs-string">'url'</span> => <span class="hljs-string">'[email protected]:park-manager/core-bundle.git'</span>, <span class="hljs-string">'sync-tags'</span> => <span class="hljs-keyword">true</span>],
],
],
<span class="hljs-comment">// ...</span>
],
];</pre>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<p>Existing tags in split repositories are always ignored.</p>
<div class="section">
<h3 id="changed-only-releases">
Changed-only Releases
<a class="headerlink" href="#changed-only-releases" title="Permalink to this headline">¶</a>
</h3>
<p>By default a new release will create tags for all split targets, but it's
possible to ignore creating tags for split targets which haven't changed
since the last release.</p>
<div class="admonition admonition-note ">
<p class="admonition-title">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="24" height="24" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg>
<span>Note</span>
</p><p>All split targets still use the version increments of the monolith repository.</p>
<p>It's not possible to have package B with a different versioning when
synchronizing of tags (for the target) is still enabled.</p>
</div>
<div translate="no" class="highlight-php notranslate">
<table class="highlighttable">
<tbody>
<tr>
<td class="linenos">
<div class="linenodiv">
<pre>1
2
3
4
5
6
7
8
9</pre>
</div>
</td>
<td class="code">
<div class="highlight">
<pre class="hljs php"><span class="hljs-keyword">return</span> [
<span class="hljs-comment">// ...</span>
<span class="hljs-string">'release'</span> => [
<span class="hljs-string">'split'</span> => <span class="hljs-string">'changed-only'</span>,
<span class="hljs-comment">// ...</span>
],
];</pre>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</section>
</div>
<script type="text/javascript" src="assets/js/theme.js"></script>
<script type="text/javascript" src="assets/js/badge_only.js"></script>
</body>
</html>