perlgit >
5.16.1
との差分
perlgit 5.16.1 と 5.24.1 の差分
1 | 1 | |
2 | 2 | =encoding utf8 |
3 | 3 | |
4 | 4 | =for comment |
5 | 5 | Consistent formatting of this file is achieved with: |
6 | 6 | perl ./Porting/podtidy pod/perlgit.pod |
7 | 7 | |
8 | 8 | =head1 NAME |
9 | 9 | |
10 | 10 | =begin original |
11 | 11 | |
12 | 12 | perlgit - Detailed information about git and the Perl repository |
13 | 13 | |
14 | 14 | =end original |
15 | 15 | |
16 | 16 | perlgit - git と Perl リポジトリに関する詳細情報 |
17 | 17 | |
18 | 18 | =head1 DESCRIPTION |
19 | 19 | |
20 | 20 | =begin original |
21 | 21 | |
22 | 22 | This document provides details on using git to develop Perl. If you are |
23 | 23 | just interested in working on a quick patch, see L<perlhack> first. |
24 | 24 | This document is intended for people who are regular contributors to |
25 | 25 | Perl, including those with write access to the git repository. |
26 | 26 | |
27 | 27 | =end original |
28 | 28 | |
29 | 29 | この文書は、Perl を開発するために git を使う詳細を提供します。 |
30 | 30 | 単に簡単なパッチに対して作業することに興味があるなら、 |
31 | 31 | まず L<perlhack> を参照してください。 |
32 | 32 | この文書は、git リポジトリへの書き込みアクセスを持つ人々を含む、 |
33 | 33 | Perl の定期的な貢献者である人々のためを意図しています。 |
34 | 34 | |
35 | 35 | =head1 CLONING THE REPOSITORY |
36 | 36 | |
37 | 37 | (リポジトリをクローンする) |
38 | 38 | |
39 | 39 | =begin original |
40 | 40 | |
41 | 41 | All of Perl's source code is kept centrally in a Git repository at |
42 | 42 | I<perl5.git.perl.org>. |
43 | 43 | |
44 | 44 | =end original |
45 | 45 | |
46 | 46 | Perlのソースコードはすべて、I<perl5.git.perl.org> の Git リポジトリに |
47 | 47 | 集中管理されています。 |
48 | 48 | |
49 | 49 | =begin original |
50 | 50 | |
51 | 51 | You can make a read-only clone of the repository by running: |
52 | 52 | |
53 | 53 | =end original |
54 | 54 | |
55 | 55 | これを実行することでリポジトリの読み込み専用のクローンを作ることができます: |
56 | 56 | |
57 | 57 | % git clone git://perl5.git.perl.org/perl.git perl |
58 | 58 | |
59 | 59 | =begin original |
60 | 60 | |
61 | 61 | This uses the git protocol (port 9418). |
62 | 62 | |
63 | 63 | =end original |
64 | 64 | |
65 | 65 | これは git プロトコル (ポート 9418) を使います。 |
66 | 66 | |
67 | 67 | =begin original |
68 | 68 | |
69 | 69 | If you cannot use the git protocol for firewall reasons, you can also |
70 | 70 | clone via http, though this is much slower: |
71 | 71 | |
72 | 72 | =end original |
73 | 73 | |
74 | 74 | ファイアウォールの関係で git プロトコルが使えない場合、 |
75 | 75 | http 経由でもクローンできますが、はるかに遅いです: |
76 | 76 | |
77 | 77 | % git clone http://perl5.git.perl.org/perl.git perl |
78 | 78 | |
79 | 79 | =head1 WORKING WITH THE REPOSITORY |
80 | 80 | |
81 | 81 | (リポジトリでの作業) |
82 | 82 | |
83 | 83 | =begin original |
84 | 84 | |
85 | 85 | Once you have changed into the repository directory, you can inspect |
86 | 86 | it. After a clone the repository will contain a single local branch, |
87 | 87 | which will be the current branch as well, as indicated by the asterisk. |
88 | 88 | |
89 | 89 | =end original |
90 | 90 | |
91 | 91 | リポジトリディレクトリに変更を加えたら、そのディレクトリを検査できます。 |
92 | 92 | クローン作成後、リポジトリには単一のローカルブランチが含まれます。 |
93 | 93 | このローカルブランチは、アスタリスクで示されているように、 |
94 | 94 | 現在のブランチにもなります。 |
95 | 95 | |
96 | 96 | % git branch |
97 | 97 | * blead |
98 | 98 | |
99 | 99 | =begin original |
100 | 100 | |
101 | 101 | Using the -a switch to C<branch> will also show the remote tracking |
102 | 102 | branches in the repository: |
103 | 103 | |
104 | 104 | =end original |
105 | 105 | |
106 | 106 | C<branch> に -a スイッチを使用すると、リポジトリ内の |
107 | 107 | リモート追跡ブランチも表示されます: |
108 | 108 | |
109 | 109 | % git branch -a |
110 | 110 | * blead |
111 | 111 | origin/HEAD |
112 | 112 | origin/blead |
113 | 113 | ... |
114 | 114 | |
115 | 115 | =begin original |
116 | 116 | |
117 | 117 | The branches that begin with "origin" correspond to the "git remote" |
118 | 118 | that you cloned from (which is named "origin"). Each branch on the |
119 | 119 | remote will be exactly tracked by these branches. You should NEVER do |
120 | 120 | work on these remote tracking branches. You only ever do work in a |
121 | 121 | local branch. Local branches can be configured to automerge (on pull) |
122 | 122 | from a designated remote tracking branch. This is the case with the |
123 | 123 | default branch C<blead> which will be configured to merge from the |
124 | 124 | remote tracking branch C<origin/blead>. |
125 | 125 | |
126 | 126 | =end original |
127 | 127 | |
128 | 128 | "origin" で始まるブランチは、クローン元の "git remote" |
129 | 129 | ("origin" という名前) に対応します。 |
130 | 130 | リモートの各ブランチは、これらのブランチによって正確に追跡されます。 |
131 | 131 | これらのリモート追跡ブランチでは絶対に作業しないでください。 |
132 | 132 | ローカルブランチでのみ作業します。 |
133 | 133 | ローカルブランチは、指定されたリモート追跡ブランチから |
134 | 134 | (プル時に)自動マージするように構成できます。 |
135 | 135 | これは、リモート追跡ブランチ C<origin/blead> からマージするように |
136 | 136 | 構成されているデフォルトブランチ C<blead> の場合です。 |
137 | 137 | |
138 | 138 | =begin original |
139 | 139 | |
140 | 140 | You can see recent commits: |
141 | 141 | |
142 | 142 | =end original |
143 | 143 | |
144 | 144 | 最近のコミットを見られます: |
145 | 145 | |
146 | 146 | % git log |
147 | 147 | |
148 | 148 | =begin original |
149 | 149 | |
150 | 150 | And pull new changes from the repository, and update your local |
151 | 151 | repository (must be clean first) |
152 | 152 | |
153 | 153 | =end original |
154 | 154 | |
155 | 155 | リポジトリから新しい変更をプルし、ローカルリポジトリを更新します |
156 | 156 | (最初にクリーンにする必要があります)。 |
157 | 157 | |
158 | 158 | % git pull |
159 | 159 | |
160 | 160 | =begin original |
161 | 161 | |
162 | 162 | Assuming we are on the branch C<blead> immediately after a pull, this |
163 | 163 | command would be more or less equivalent to: |
164 | 164 | |
165 | 165 | =end original |
166 | 166 | |
167 | 167 | プルの直後にブランチ C<blead> にいると仮定すると、このコマンドは |
168 | 168 | 以下とほぼ等価になります: |
169 | 169 | |
170 | 170 | % git fetch |
171 | 171 | % git merge origin/blead |
172 | 172 | |
173 | 173 | =begin original |
174 | 174 | |
175 | 175 | In fact if you want to update your local repository without touching |
176 | 176 | your working directory you do: |
177 | 177 | |
178 | 178 | =end original |
179 | 179 | |
180 | 180 | 実際、作業ディレクトリにアクセスせずにローカルリポジトリを更新したい場合は、 |
181 | 181 | 次のようにします: |
182 | 182 | |
183 | 183 | % git fetch |
184 | 184 | |
185 | 185 | =begin original |
186 | 186 | |
187 | 187 | And if you want to update your remote-tracking branches for all defined |
188 | 188 | remotes simultaneously you can do |
189 | 189 | |
190 | 190 | =end original |
191 | 191 | |
192 | 192 | また、定義されたすべてのリモートに対してリモート追跡ブランチを |
193 | 193 | 同時に更新したい場合は、以下のように行うことができます: |
194 | 194 | |
195 | 195 | % git remote update |
196 | 196 | |
197 | 197 | =begin original |
198 | 198 | |
199 | 199 | Neither of these last two commands will update your working directory, |
200 | 200 | however both will update the remote-tracking branches in your |
201 | 201 | repository. |
202 | 202 | |
203 | 203 | =end original |
204 | 204 | |
205 | 205 | 最後の二つのコマンドはどちらも作業ディレクトリを更新しませんが、どちらも |
206 | 206 | リポジトリ内のリモート追跡ブランチを更新します。 |
207 | 207 | |
208 | 208 | =begin original |
209 | 209 | |
210 | 210 | To make a local branch of a remote branch: |
211 | 211 | |
212 | 212 | =end original |
213 | 213 | |
214 | 214 | リモートブランチのローカルブランチを作るには: |
215 | 215 | |
216 | 216 | % git checkout -b maint-5.10 origin/maint-5.10 |
217 | 217 | |
218 | 218 | =begin original |
219 | 219 | |
220 | 220 | To switch back to blead: |
221 | 221 | |
222 | 222 | =end original |
223 | 223 | |
224 | 224 | blead に戻るには: |
225 | 225 | |
226 | 226 | % git checkout blead |
227 | 227 | |
228 | 228 | =head2 Finding out your status |
229 | 229 | |
230 | 230 | (現在の状態を確認する) |
231 | 231 | |
232 | 232 | =begin original |
233 | 233 | |
234 | 234 | The most common git command you will use will probably be |
235 | 235 | |
236 | 236 | =end original |
237 | 237 | |
238 | 238 | おそらくもっともよく使う git コマンドは: |
239 | 239 | |
240 | 240 | % git status |
241 | 241 | |
242 | 242 | =begin original |
243 | 243 | |
244 | 244 | This command will produce as output a description of the current state |
245 | 245 | of the repository, including modified files and unignored untracked |
246 | 246 | files, and in addition it will show things like what files have been |
247 | 247 | staged for the next commit, and usually some useful information about |
248 | 248 | how to change things. For instance the following: |
249 | 249 | |
250 | 250 | =end original |
251 | 251 | |
252 | 252 | このコマンドは、変更されたファイルや無視されていない |
253 | 253 | 追跡されていないファイルなど、リポジトリの現在の状態の説明を |
254 | 254 | 出力として生成します。 |
255 | 255 | さらに、次のコミットのためにステージングされたファイルや、 |
256 | 256 | 通常は変更方法に関する有用な情報を表示します。 |
257 | 257 | たとえば、次のようになります: |
258 | 258 | |
259 | | |
259 | % git status | |
260 | | |
260 | On branch blead | |
261 | | |
261 | Your branch is ahead of 'origin/blead' by 1 commit. | |
262 | # | |
263 | # Changes to be committed: | |
264 | # (use "git reset HEAD <file>..." to unstage) | |
265 | # | |
266 | # modified: pod/perlgit.pod | |
267 | # | |
268 | # Changed but not updated: | |
269 | # (use "git add <file>..." to update what will be committed) | |
270 | # | |
271 | # modified: pod/perlgit.pod | |
272 | # | |
273 | # Untracked files: | |
274 | # (use "git add <file>..." to include in what will be committed) | |
275 | # | |
276 | # deliberate.untracked | |
277 | 262 | |
263 | Changes to be committed: | |
264 | (use "git reset HEAD <file>..." to unstage) | |
265 | ||
266 | modified: pod/perlgit.pod | |
267 | ||
268 | Changes not staged for commit: | |
269 | (use "git add <file>..." to update what will be committed) | |
270 | (use "git checkout -- <file>..." to discard changes in working | |
271 | directory) | |
272 | ||
273 | modified: pod/perlgit.pod | |
274 | ||
275 | Untracked files: | |
276 | (use "git add <file>..." to include in what will be committed) | |
277 | ||
278 | deliberate.untracked | |
279 | ||
278 | 280 | =begin original |
279 | 281 | |
280 | 282 | This shows that there were changes to this document staged for commit, |
281 | 283 | and that there were further changes in the working directory not yet |
282 | 284 | staged. It also shows that there was an untracked file in the working |
283 | 285 | directory, and as you can see shows how to change all of this. It also |
284 | 286 | shows that there is one commit on the working branch C<blead> which has |
285 | not been pushed to the C<origin> remote yet. B<NOTE>: | |
287 | not been pushed to the C<origin> remote yet. B<NOTE>: This output | |
286 | 288 | is also what you see as a template if you do not provide a message to |
287 | 289 | C<git commit>. |
288 | 290 | |
289 | 291 | =end original |
290 | 292 | |
291 | 293 | これは、コミットのためにステージングされたこの文書に変更があったことと、 |
292 | 294 | まだステージングされていないワーキングディレクトリに |
293 | 295 | さらに変更があったことを示しています。 |
294 | 296 | また、ワーキングディレクトリに追跡されていないファイルが |
295 | 297 | あったことも示しています; |
296 | 298 | また、これらすべてを変更する方法を示しています。 |
297 | 299 | また、C<origin> リモートにまだプッシュされていないワーキングブランチ |
298 | 300 | C<blead> に一つのコミットがあることも示しています。 |
299 | 301 | B<注>: この出力は、C<git commit> にメッセージを提供しない場合に |
300 | 302 | テンプレートとして表示されるものでもあります。 |
301 | 303 | |
302 | 304 | =head2 Patch workflow |
303 | 305 | |
304 | 306 | (パッチのワークフロー) |
305 | 307 | |
306 | 308 | =begin original |
307 | 309 | |
308 | 310 | First, please read L<perlhack> for details on hacking the Perl core. |
309 | 311 | That document covers many details on how to create a good patch. |
310 | 312 | |
311 | 313 | =end original |
312 | 314 | |
313 | 315 | まず、Perl コアをハックするための詳細については L<perlhack> を読んでください。 |
314 | 316 | この文書はよいパッチの作り方に関する多くの詳細に対応しています。 |
315 | 317 | |
316 | 318 | =begin original |
317 | 319 | |
318 | 320 | If you already have a Perl repository, you should ensure that you're on |
319 | 321 | the I<blead> branch, and your repository is up to date: |
320 | 322 | |
321 | 323 | =end original |
322 | 324 | |
323 | 325 | すでに Perl リポジトリを持っている場合は、 |
324 | 326 | I<blead> ブランチにいて、リポジトリが最新であることを確認する必要があります: |
325 | 327 | |
326 | 328 | % git checkout blead |
327 | 329 | % git pull |
328 | 330 | |
329 | 331 | =begin original |
330 | 332 | |
331 | 333 | It's preferable to patch against the latest blead version, since this |
332 | 334 | is where new development occurs for all changes other than critical bug |
333 | 335 | fixes. Critical bug fix patches should be made against the relevant |
334 | 336 | maint branches, or should be submitted with a note indicating all the |
335 | 337 | branches where the fix should be applied. |
336 | 338 | |
337 | 339 | =end original |
338 | 340 | |
339 | 341 | 最新の blead バージョンに対してパッチを適用することをお勧めします。 |
340 | 342 | これは、重大なバグ修正以外のすべての変更に対して新たな開発が行われる |
341 | 343 | 場所であるためです。 |
342 | 344 | 重大なバグ修正パッチは、関連するメインブランチに対して作成するか、 |
343 | 345 | 修正が適用されるすべてのブランチを示すメモとともに提出する必要があります。 |
344 | 346 | |
345 | 347 | =begin original |
346 | 348 | |
347 | 349 | Now that we have everything up to date, we need to create a temporary |
348 | 350 | new branch for these changes and switch into it: |
349 | 351 | |
350 | 352 | =end original |
351 | 353 | |
352 | 354 | すべてが最新の状態になったので、これらの変更に対して一時的な |
353 | 355 | 新しいブランチを作成し、そのブランチに切り替える必要があります: |
354 | 356 | |
355 | 357 | % git checkout -b orange |
356 | 358 | |
357 | 359 | =begin original |
358 | 360 | |
359 | 361 | which is the short form of |
360 | 362 | |
361 | 363 | =end original |
362 | 364 | |
363 | 365 | これは以下のものの短縮形です |
364 | 366 | |
365 | 367 | % git branch orange |
366 | 368 | % git checkout orange |
367 | 369 | |
368 | 370 | =begin original |
369 | 371 | |
370 | 372 | Creating a topic branch makes it easier for the maintainers to rebase |
371 | 373 | or merge back into the master blead for a more linear history. If you |
372 | 374 | don't work on a topic branch the maintainer has to manually cherry pick |
373 | 375 | your changes onto blead before they can be applied. |
374 | 376 | |
375 | 377 | =end original |
376 | 378 | |
377 | 379 | トピックブランチを作成することで、メンテナはよりリニアな履歴のために |
378 | 380 | master blead にリベースまたはマージバックすることが簡単になります。 |
379 | 381 | トピックブランチで作業しない場合、 |
380 | 382 | メンテナは変更を適用する前に手動で blead にチェリーピックする |
381 | 383 | 必要があります。 |
382 | 384 | |
383 | 385 | =begin original |
384 | 386 | |
385 | 387 | That'll get you scolded on perl5-porters, so don't do that. Be Awesome. |
386 | 388 | |
387 | 389 | =end original |
388 | 390 | |
389 | 391 | perl5-porters で叱られることになるので、そんなことはしないでください。 |
390 | 392 | うまくやりましょう。 |
391 | 393 | |
392 | 394 | =begin original |
393 | 395 | |
394 | 396 | Then make your changes. For example, if Leon Brocard changes his name |
395 | 397 | to Orange Brocard, we should change his name in the AUTHORS file: |
396 | 398 | |
397 | 399 | =end original |
398 | 400 | |
399 | 401 | 次に、変更を加えます。 |
400 | 402 | たとえば、Leon Brocard が名前を Orange Brocard に変更した場合、 |
401 | 403 | AUTHORS ファイル内の名前を変更する必要があります: |
402 | 404 | |
403 | 405 | % perl -pi -e 's{Leon Brocard}{Orange Brocard}' AUTHORS |
404 | 406 | |
405 | 407 | =begin original |
406 | 408 | |
407 | 409 | You can see what files are changed: |
408 | 410 | |
409 | 411 | =end original |
410 | 412 | |
411 | 413 | どのファイルを変更したかを見られます: |
412 | 414 | |
413 | 415 | % git status |
414 | | |
416 | On branch orange | |
415 | | |
417 | Changes to be committed: | |
416 | | |
418 | (use "git reset HEAD <file>..." to unstage) | |
417 | # | |
418 | # modified: AUTHORS | |
419 | # | |
420 | 419 | |
420 | modified: AUTHORS | |
421 | ||
421 | 422 | =begin original |
422 | 423 | |
423 | 424 | And you can see the changes: |
424 | 425 | |
425 | 426 | =end original |
426 | 427 | |
427 | 428 | そして変更が見られます: |
428 | 429 | |
429 | | |
430 | % git diff | |
430 | | |
431 | diff --git a/AUTHORS b/AUTHORS | |
431 | | |
432 | index 293dd70..722c93e 100644 | |
432 | | |
433 | --- a/AUTHORS | |
433 | | |
434 | +++ b/AUTHORS | |
434 | | |
435 | @@ -541,7 +541,7 @@ Lars Hecking <lhecking@nmrc.ucc.ie> | |
435 | | |
436 | Laszlo Molnar <laszlo.molnar@eth.ericsson.se> | |
436 | | |
437 | Leif Huhn <leif@hale.dkstat.com> | |
437 | | |
438 | Len Johnson <lenjay@ibm.net> | |
438 | | |
439 | -Leon Brocard <acme@astray.com> | |
439 | | |
440 | +Orange Brocard <acme@astray.com> | |
440 | | |
441 | Les Peters <lpeters@aol.net> | |
441 | | |
442 | Lesley Binks <lesley.binks@gmail.com> | |
442 | | |
443 | Lincoln D. Stein <lstein@cshl.org> | |
443 | 444 | |
444 | 445 | =begin original |
445 | 446 | |
446 | 447 | Now commit your change locally: |
447 | 448 | |
448 | 449 | =end original |
449 | 450 | |
450 | 451 | ここで変更をローカルにコミットします: |
451 | 452 | |
452 | | |
453 | % git commit -a -m 'Rename Leon Brocard to Orange Brocard' | |
453 | | |
454 | Created commit 6196c1d: Rename Leon Brocard to Orange Brocard | |
454 | | |
455 | 1 files changed, 1 insertions(+), 1 deletions(-) | |
455 | 456 | |
456 | 457 | =begin original |
457 | 458 | |
458 | 459 | The C<-a> option is used to include all files that git tracks that you |
459 | 460 | have changed. If at this time, you only want to commit some of the |
460 | 461 | files you have worked on, you can omit the C<-a> and use the command |
461 | 462 | C<S<git add I<FILE ...>>> before doing the commit. C<S<git add |
462 | 463 | --interactive>> allows you to even just commit portions of files |
463 | 464 | instead of all the changes in them. |
464 | 465 | |
465 | 466 | =end original |
466 | 467 | |
467 | 468 | C<-a> オプションは、git が追跡しているファイルの中であなたが変更した |
468 | 469 | 全てのファイルを含むために使われます。 |
469 | 470 | もしこの時点で、作業したファイルの一部だけをコミットしたい場合は、 |
470 | 471 | C<-a> を省略して、コミットを行う前にコマンド |
471 | 472 | C<S<git add I<FILE ...>>> を使ってください。 |
472 | 473 | C<S<git add --interactive>> は、ファイル中の全ての変更ではなく、 |
473 | 474 | ファイルの一部をコミットできるようにします。 |
474 | 475 | |
475 | 476 | =begin original |
476 | 477 | |
477 | 478 | The C<-m> option is used to specify the commit message. If you omit it, |
478 | 479 | git will open a text editor for you to compose the message |
479 | 480 | interactively. This is useful when the changes are more complex than |
480 | 481 | the sample given here, and, depending on the editor, to know that the |
481 | 482 | first line of the commit message doesn't exceed the 50 character legal |
482 | 483 | maximum. |
483 | 484 | |
484 | 485 | =end original |
485 | 486 | |
486 | 487 | C<-m> オプションはコミットメッセージを指定するために使われます。 |
487 | 488 | これを省略すると、git はメッセージを対話的に作成するために |
488 | 489 | テキストエディタを開きます。 |
489 | 490 | これは、変更がここで指定するサンプルよりも複雑な場合、そして |
490 | 491 | エディタによっては、コミットメッセージの先頭行が上限の |
491 | 492 | 50 文字を超えないことを知るために有用です。 |
492 | 493 | |
493 | 494 | =begin original |
494 | 495 | |
495 | 496 | Once you've finished writing your commit message and exited your |
496 | 497 | editor, git will write your change to disk and tell you something like |
497 | 498 | this: |
498 | 499 | |
499 | 500 | =end original |
500 | 501 | |
501 | 502 | コミットメッセージを書き終えてエディタを終了すると、 |
502 | 503 | git は変更をディスクに書き込み、以下のようなメッセージを出力します: |
503 | 504 | |
504 | | |
505 | Created commit daf8e63: explain git status and stuff about remotes | |
505 | | |
506 | 1 files changed, 83 insertions(+), 3 deletions(-) | |
506 | 507 | |
507 | 508 | =begin original |
508 | 509 | |
509 | 510 | If you re-run C<git status>, you should see something like this: |
510 | 511 | |
511 | 512 | =end original |
512 | 513 | |
513 | 514 | C<git status> を再実行すると、次のようなものが表示されます: |
514 | 515 | |
515 | | |
516 | % git status | |
516 | | |
517 | On branch orange | |
517 | | |
518 | Untracked files: | |
518 | | |
519 | (use "git add <file>..." to include in what will be committed) | |
519 | # Untracked files: | |
520 | # (use "git add <file>..." to include in what will be committed) | |
521 | # | |
522 | # deliberate.untracked | |
523 | nothing added to commit but untracked files present (use "git add" to track) | |
524 | 520 | |
521 | deliberate.untracked | |
522 | ||
523 | nothing added to commit but untracked files present (use "git add" to | |
524 | track) | |
525 | ||
525 | 526 | =begin original |
526 | 527 | |
527 | 528 | When in doubt, before you do anything else, check your status and read |
528 | 529 | it carefully, many questions are answered directly by the git status |
529 | 530 | output. |
530 | 531 | |
531 | 532 | =end original |
532 | 533 | |
533 | 534 | 疑わしいときには、他のことをする前に、ステータスをチェックして |
534 | 535 | 注意深く読んでください; |
535 | 536 | 多くの疑問は git status の出力で直接応えられています。 |
536 | 537 | |
537 | 538 | =begin original |
538 | 539 | |
539 | 540 | You can examine your last commit with: |
540 | 541 | |
541 | 542 | =end original |
542 | 543 | |
543 | 544 | 最後のコミットを以下のようにして検査できます: |
544 | 545 | |
545 | 546 | % git show HEAD |
546 | 547 | |
547 | 548 | =begin original |
548 | 549 | |
549 | 550 | and if you are not happy with either the description or the patch |
550 | 551 | itself you can fix it up by editing the files once more and then issue: |
551 | 552 | |
552 | 553 | =end original |
553 | 554 | |
554 | 555 | 説明またはパッチ自体に満足できない場合は、ファイルをもう一度編集してから |
555 | 556 | 次のコマンドを発行することで修正できます: |
556 | 557 | |
557 | 558 | % git commit -a --amend |
558 | 559 | |
559 | 560 | =begin original |
560 | 561 | |
561 | 562 | Now you should create a patch file for all your local changes: |
562 | 563 | |
563 | 564 | =end original |
564 | 565 | |
565 | 566 | ここで全てのローカルな変更のためのパッチファイルを作るべきです: |
566 | 567 | |
567 | % git format-patch -M | |
568 | % git format-patch -M blead.. | |
568 | 569 | 0001-Rename-Leon-Brocard-to-Orange-Brocard.patch |
569 | 570 | |
570 | 571 | =begin original |
571 | 572 | |
573 | Or for a lot of changes, e.g. from a topic branch: | |
574 | ||
575 | =end original | |
576 | ||
577 | あるいは変更が多い場合、つまりトピックブランチからは: | |
578 | ||
579 | % git format-patch --stdout -M blead.. > topic-branch-changes.patch | |
580 | ||
581 | =begin original | |
582 | ||
572 | 583 | You should now send an email to |
573 | 584 | L<perlbug@perl.org|mailto:perlbug@perl.org> with a description of your |
574 | 585 | changes, and include this patch file as an attachment. In addition to |
575 | 586 | being tracked by RT, mail to perlbug will automatically be forwarded to |
576 | 587 | perl5-porters (with manual moderation, so please be patient). You |
577 | 588 | should only send patches to |
578 | 589 | L<perl5-porters@perl.org|mailto:perl5-porters@perl.org> directly if the |
579 | 590 | patch is not ready to be applied, but intended for discussion. |
580 | 591 | |
581 | 592 | =end original |
582 | 593 | |
583 | 594 | L<perlbug@perl.org|mailto:perlbug@perl.org> 宛に変更内容を記載した |
584 | 595 | メールを送信し、このパッチファイルを添付ファイルとして送ってください。 |
585 | 596 | RT で追跡することに加えて、 |
586 | 597 | perlbug にメールすると、自動的に |
587 | 598 | perl5-porters に (手動のモデレーションの後、従って気長に待ってください) |
588 | 599 | 転送されます。 |
589 | 600 | パッチは適用する準備ができていない状態だけれども議論したい場合は、 |
590 | 601 | L<perl5-porters@perl.org|mailto:perl5-porters@perl.org> だけに |
591 | 602 | 直接メールを送るべきです。 |
592 | 603 | |
593 | 604 | =begin original |
594 | 605 | |
595 | ||
606 | Please do not use git-send-email(1) to send your patch. See L<Sending | |
596 | emails for | |
607 | patch emails|/Sending patch emails> for more information. | |
597 | 608 | |
598 | 609 | =end original |
599 | 610 | |
600 | ||
611 | パッチを送るのに git-send-email(1) を使わないでください。 | |
601 | ||
612 | さらなる情報については | |
613 | L<Sending patch emails|/Sending patch emails> を参照してください。 | |
602 | 614 | |
603 | 615 | =begin original |
604 | 616 | |
605 | 617 | If you want to delete your temporary branch, you may do so with: |
606 | 618 | |
607 | 619 | =end original |
608 | 620 | |
609 | 621 | 一時的なブランチを削除したいなら、以下のようにできます: |
610 | 622 | |
611 | | |
623 | % git checkout blead | |
612 | | |
624 | % git branch -d orange | |
613 | | |
625 | error: The branch 'orange' is not an ancestor of your current HEAD. | |
614 | | |
626 | If you are sure you want to delete it, run 'git branch -D orange'. | |
615 | | |
627 | % git branch -D orange | |
616 | | |
628 | Deleted branch orange. | |
617 | 629 | |
618 | 630 | =head2 Committing your changes |
619 | 631 | |
620 | 632 | (変更をコミットする) |
621 | 633 | |
622 | 634 | =begin original |
623 | 635 | |
624 | 636 | Assuming that you'd like to commit all the changes you've made as a |
625 | 637 | single atomic unit, run this command: |
626 | 638 | |
627 | 639 | =end original |
628 | 640 | |
629 | 641 | 今行ったすべての変更を一つのアトミックユニットとしてコミットしたい場合は、 |
630 | 642 | 次のコマンドを実行します: |
631 | 643 | |
632 | | |
644 | % git commit -a | |
633 | 645 | |
634 | 646 | =begin original |
635 | 647 | |
636 | 648 | (That C<-a> tells git to add every file you've changed to this commit. |
637 | 649 | New files aren't automatically added to your commit when you use |
638 | 650 | C<commit -a> If you want to add files or to commit some, but not all of |
639 | 651 | your changes, have a look at the documentation for C<git add>.) |
640 | 652 | |
641 | 653 | =end original |
642 | 654 | |
643 | 655 | (C<-a> は git に対して、変更したすべてのファイルをこのコミットに |
644 | 656 | 追加するように指示します。 |
645 | 657 | C<commit -a> を使用しても、新しいファイルは自動的にコミットに追加されません。 |
646 | 658 | ファイルを追加したい場合や、一部の変更をコミットしたい場合は、 |
647 | 659 | C<git add> の文書を参照してください。 |
648 | 660 | |
649 | 661 | =begin original |
650 | 662 | |
651 | 663 | Git will start up your favorite text editor, so that you can craft a |
652 | 664 | commit message for your change. See L<perlhack/Commit message> for more |
653 | 665 | information about what makes a good commit message. |
654 | 666 | |
655 | 667 | =end original |
656 | 668 | |
657 | 669 | Git は、あなたが変更内容のコミットメッセージを作成できるように、 |
658 | 670 | お気に入りのテキストエディタを起動します。 |
659 | 671 | 適切なコミットメッセージを作成する方法に関するさらなる情報については、 |
660 | 672 | L</Commit message> を参照してください。 |
661 | 673 | |
662 | 674 | =begin original |
663 | 675 | |
664 | 676 | Once you've finished writing your commit message and exited your |
665 | 677 | editor, git will write your change to disk and tell you something like |
666 | 678 | this: |
667 | 679 | |
668 | 680 | =end original |
669 | 681 | |
670 | 682 | コミットメッセージを書き終えてエディタを終了すると、 |
671 | 683 | git は変更をディスクに書き込み、以下のようなメッセージを出力します: |
672 | 684 | |
673 | | |
685 | Created commit daf8e63: explain git status and stuff about remotes | |
674 | | |
686 | 1 files changed, 83 insertions(+), 3 deletions(-) | |
675 | 687 | |
676 | 688 | =begin original |
677 | 689 | |
678 | 690 | If you re-run C<git status>, you should see something like this: |
679 | 691 | |
680 | 692 | =end original |
681 | 693 | |
682 | 694 | C<git status> を再実行すると、次のようなものが表示されます: |
683 | 695 | |
684 | | |
696 | % git status | |
685 | | |
697 | On branch blead | |
686 | | |
698 | Your branch is ahead of 'origin/blead' by 2 commits. | |
687 | | |
699 | (use "git push" to publish your local commits) | |
688 | | |
700 | Untracked files: | |
689 | | |
701 | (use "git add <file>..." to include in what will be committed) | |
690 | # | |
691 | # deliberate.untracked | |
692 | nothing added to commit but untracked files present (use "git add" to track) | |
693 | 702 | |
703 | deliberate.untracked | |
704 | ||
705 | nothing added to commit but untracked files present (use "git add" to | |
706 | track) | |
707 | ||
694 | 708 | =begin original |
695 | 709 | |
696 | 710 | When in doubt, before you do anything else, check your status and read |
697 | 711 | it carefully, many questions are answered directly by the git status |
698 | 712 | output. |
699 | 713 | |
700 | 714 | =end original |
701 | 715 | |
702 | 716 | 何か疑問がある場合には、何かをする前に自分のステータスをチェックして |
703 | 717 | 注意深く読んでください; |
704 | 718 | 多くの疑問に対しては、git status 出力が直接答えてくれます。 |
705 | 719 | |
706 | =head2 | |
720 | =head2 Sending patch emails | |
707 | 721 | |
708 | (パッチをメールする | |
722 | (パッチをメールする) | |
709 | 723 | |
710 | 724 | =begin original |
711 | 725 | |
712 | ||
726 | After you've generated your patch you should send it | |
713 | ||
727 | to L<perlbug@perl.org|mailto:perlbug@perl.org> (as discussed L<in the | |
728 | previous section|/"Patch workflow">) with a normal mail client as an | |
729 | attachment, along with a description of the patch. | |
714 | 730 | |
715 | 731 | =end original |
716 | 732 | |
717 | パッチを | |
733 | パッチを作ったら、 | |
734 | (L<前の節|/"Patch workflow"> で議論したように) | |
735 | それを添付ファイルにして、パッチの説明と共に、 | |
736 | 通常のメールクライアントで | |
737 | L<perlbug@perl.org|mailto:perlbug@perl.org> に送ってください。 | |
718 | 738 | |
719 | 739 | =begin original |
720 | 740 | |
721 | ||
741 | You B<must not> use git-send-email(1) to send patches generated with | |
722 | tracke | |
742 | git-format-patch(1). The RT ticketing system living behind | |
743 | L<perlbug@perl.org|mailto:perlbug@perl.org> does not respect the inline | |
744 | contents of E-Mails, sending an inline patch to RT guarantees that your | |
745 | patch will be destroyed. | |
723 | 746 | |
724 | 747 | =end original |
725 | 748 | |
726 | ||
749 | git-format-patch(1) で生成したパッチを送るのに git-send-email(1) を | |
727 | ||
750 | 使っては B<いけません>。 | |
751 | L<perlbug@perl.org|mailto:perlbug@perl.org> の後ろで動いている | |
752 | RT チケットシステムは、 | |
753 | 電子メールのインラインコンテンツを認識しないので、 | |
754 | RT にインラインでパッチを送ると、パッチは破壊されます。 | |
728 | 755 | |
729 | $ git config sendemail.to perlbug@perl.org | |
730 | ||
731 | 756 | =begin original |
732 | 757 | |
733 | ||
758 | Someone may download your patch from RT, which will result in the | |
759 | subject (the first line of the commit message) being omitted. See | |
760 | L<RT #74192|https://rt.perl.org/Ticket/Display.html?id=74192> and | |
761 | L<commit a4583001|http://perl5.git.perl.org/perl.git/commitdiff/a4583001> | |
762 | for an example. Alternatively someone may | |
763 | apply your patch from RT after it arrived in their mailbox, by which | |
764 | time RT will have modified the inline content of the message. See | |
765 | L<RT #74532|https://rt.perl.org/Ticket/Display.html?id=74532> and | |
766 | L<commit f9bcfeac|http://perl5.git.perl.org/perl.git/commitdiff/f9bcfeac> | |
767 | for a bad example of this failure mode. | |
734 | 768 | |
735 | 769 | =end original |
736 | 770 | |
737 | ||
771 | 誰かが RT からパッチをダウンロードすると、題名 (コミットメッセージの | |
772 | 最初の行) は削除されます。 | |
773 | 例えば | |
774 | L<RT #74192|https://rt.perl.org/Ticket/Display.html?id=74192> と | |
775 | L<コミット a4583001|http://perl5.git.perl.org/perl.git/commitdiff/a4583001> | |
776 | を参照してください。 | |
777 | あるいは、誰かがメールボックスに届いた RT からのパッチを | |
778 | 適用するかもしれません; この場合 RT はメッセージのインラインコンテンツを | |
779 | 変更しています。 | |
780 | この失敗に関する悪い例は RT #74532 とコミット f9bcfeac を参照してください。 | |
738 | 781 | |
739 | $ git config sendemail.to perl5-porters@perl.org | |
740 | ||
741 | =begin original | |
742 | ||
743 | Then you can use git directly to send your patch emails: | |
744 | ||
745 | =end original | |
746 | ||
747 | その後、git を直接使ってパッチメールを送ることができます: | |
748 | ||
749 | $ git send-email 0001-Rename-Leon-Brocard-to-Orange-Brocard.patch | |
750 | ||
751 | =begin original | |
752 | ||
753 | You may need to set some configuration variables for your particular | |
754 | email service provider. For example, to set your global git config to | |
755 | send email via a gmail account: | |
756 | ||
757 | =end original | |
758 | ||
759 | 特定の電子メールサービスプロバイダに対していくつかの設定変数を設定する | |
760 | 必要があるかもしれません。 | |
761 | 例えば、gmail アカウント経由で電子メールを送信するように | |
762 | グローバル git を設定するには: | |
763 | ||
764 | $ git config --global sendemail.smtpserver smtp.gmail.com | |
765 | $ git config --global sendemail.smtpssl 1 | |
766 | $ git config --global sendemail.smtpuser YOURUSERNAME@gmail.com | |
767 | ||
768 | =begin original | |
769 | ||
770 | With this configuration, you will be prompted for your gmail password | |
771 | when you run 'git send-email'. You can also configure | |
772 | C<sendemail.smtppass> with your password if you don't care about having | |
773 | your password in the .gitconfig file. | |
774 | ||
775 | =end original | |
776 | ||
777 | この設定では、'git send-email' を実行するときに | |
778 | gmail パスワードの入力を求められます。 | |
779 | .gitconfig ファイルにパスワードを保存したくない場合は、 | |
780 | C<sendemail.smtppass> にパスワードを設定することもできます。 | |
781 | ||
782 | 782 | =head2 A note on derived files |
783 | 783 | |
784 | 784 | (派生ファイルに関する注意) |
785 | 785 | |
786 | 786 | =begin original |
787 | 787 | |
788 | 788 | Be aware that many files in the distribution are derivative--avoid |
789 | 789 | patching them, because git won't see the changes to them, and the build |
790 | 790 | process will overwrite them. Patch the originals instead. Most |
791 | 791 | utilities (like perldoc) are in this category, i.e. patch |
792 | 792 | F<utils/perldoc.PL> rather than F<utils/perldoc>. Similarly, don't |
793 | create patches for files under $src_root/ext from their copies found | |
793 | create patches for files under F<$src_root/ext> from their copies found | |
794 | $install_root/lib. If you are unsure about the proper location of | |
794 | in F<$install_root/lib>. If you are unsure about the proper location of | |
795 | file that may have gotten copied while building the source | |
795 | a file that may have gotten copied while building the source | |
796 | distribution, consult the | |
796 | distribution, consult the F<MANIFEST>. | |
797 | 797 | |
798 | 798 | =end original |
799 | 799 | |
800 | 800 | ディストリビューション内の多くのファイルは |
801 | 801 | 派生的なものであることに注意してください -- |
802 | 802 | それらのファイルにパッチを当てることは避けてください; |
803 | 803 | なぜなら、git はそれらに対する変更を見ることができず、 |
804 | 804 | ビルドプロセスがそれらを上書きするからです。 |
805 | 805 | 代わりにオリジナルにパッチを当ててください。 |
806 | 806 | ほとんどのユーティリティ(perldoc など)はこのカテゴリにあります; |
807 | 807 | すなわち、utils/perldoc ではなく F<utils/perldoc.PL> にパッチを当てます。 |
808 | 同様に、$install_root/lib にあるコピーから $src_root/ext 以下のファイルに | |
808 | 同様に、F<$install_root/lib> にあるコピーから F<$src_root/ext> 以下のファイルに | |
809 | 809 | パッチを作成しないでください。 |
810 | 810 | ソースディストリビューションのビルド中にコピーされた可能性のあるファイルの |
811 | 適切な場所がわからない場合は、 | |
811 | 適切な場所がわからない場合は、F<MANIFEST> を調べてください。 | |
812 | 812 | |
813 | 813 | =head2 Cleaning a working directory |
814 | 814 | |
815 | 815 | (作業ディレクトリを掃除する) |
816 | 816 | |
817 | 817 | =begin original |
818 | 818 | |
819 | 819 | The command C<git clean> can with varying arguments be used as a |
820 | 820 | replacement for C<make clean>. |
821 | 821 | |
822 | 822 | =end original |
823 | 823 | |
824 | 824 | C<git clean> コマンドはさまざまな引数で C<make clean> の代わりに |
825 | 825 | 使うことができます。 |
826 | 826 | |
827 | 827 | =begin original |
828 | 828 | |
829 | 829 | To reset your working directory to a pristine condition you can do: |
830 | 830 | |
831 | 831 | =end original |
832 | 832 | |
833 | 833 | 作業ディレクトリを初期状態にリセットするには、次のようにします: |
834 | 834 | |
835 | 835 | % git clean -dxf |
836 | 836 | |
837 | 837 | =begin original |
838 | 838 | |
839 | 839 | However, be aware this will delete ALL untracked content. You can use |
840 | 840 | |
841 | 841 | =end original |
842 | 842 | |
843 | 843 | ただし、これによりすべての追跡されていないコンテンツが削除されます。 |
844 | 844 | 次のようにすると: |
845 | 845 | |
846 | 846 | % git clean -Xf |
847 | 847 | |
848 | 848 | =begin original |
849 | 849 | |
850 | 850 | to remove all ignored untracked files, such as build and test |
851 | byproduct, but leave any | |
851 | byproduct, but leave any manually created files alone. | |
852 | 852 | |
853 | 853 | =end original |
854 | 854 | |
855 | 855 | ビルドやテストの副産物など、すべての無視された |
856 | 856 | 追跡されていないファイルを削除します。 |
857 | 857 | ただし、手動で作成したファイルは残します。 |
858 | 858 | |
859 | 859 | =begin original |
860 | 860 | |
861 | 861 | If you only want to cancel some uncommitted edits, you can use C<git |
862 | 862 | checkout> and give it a list of files to be reverted, or C<git checkout |
863 | 863 | -f> to revert them all. |
864 | 864 | |
865 | 865 | =end original |
866 | 866 | |
867 | 867 | コミットされていない編集だけをキャンセルしたい場合は、 |
868 | 868 | C<git checkout> を使用して元に戻すファイルのリストを与えるか、 |
869 | 869 | C<git checkout -f> を使用してすべてを元に戻すことができます。 |
870 | 870 | |
871 | 871 | =begin original |
872 | 872 | |
873 | 873 | If you want to cancel one or several commits, you can use C<git reset>. |
874 | 874 | |
875 | 875 | =end original |
876 | 876 | |
877 | 877 | 1つまたは複数のコミットをキャンセルしたい場合は、C<git reset> を |
878 | 878 | 使うことができます。 |
879 | 879 | |
880 | 880 | =head2 Bisecting |
881 | 881 | |
882 | 882 | (bisect) |
883 | 883 | |
884 | 884 | =begin original |
885 | 885 | |
886 | 886 | C<git> provides a built-in way to determine which commit should be blamed |
887 | 887 | for introducing a given bug. C<git bisect> performs a binary search of |
888 | 888 | history to locate the first failing commit. It is fast, powerful and |
889 | 889 | flexible, but requires some setup and to automate the process an auxiliary |
890 | 890 | shell script is needed. |
891 | 891 | |
892 | 892 | =end original |
893 | 893 | |
894 | 894 | C<git> は、指定されたバグが導入されたのがどのコミットに責任があるかを |
895 | 895 | 決定する組み込みの手段を提供しています。 |
896 | 896 | C<git bisect> は失敗する最初のコミットを特定するために |
897 | 897 | 履歴の二分検索を行います。 |
898 | 898 | これは高速で強力で柔軟性がありますが、多少の準備が必要で、 |
899 | 899 | 処理を自動化するには外部シェルスクリプトが必要です。 |
900 | 900 | |
901 | 901 | =begin original |
902 | 902 | |
903 | 903 | The core provides a wrapper program, F<Porting/bisect.pl>, which attempts to |
904 | 904 | simplify as much as possible, making bisecting as simple as running a Perl |
905 | 905 | one-liner. For example, if you want to know when this became an error: |
906 | 906 | |
907 | 907 | =end original |
908 | 908 | |
909 | 909 | コアはラッパプログラムである F<Porting/bisect.pl> を提供しています; |
910 | 910 | これはできるだけ作業を単純化して、 |
911 | 911 | Perl のワンライナーを実行するだけで bisect ができるようにします。 |
912 | 912 | 例えば、次のものがいつエラーになったかを知りたい場合: |
913 | 913 | |
914 | 914 | perl -e 'my $a := 2' |
915 | 915 | |
916 | 916 | =begin original |
917 | 917 | |
918 | 918 | you simply run this: |
919 | 919 | |
920 | 920 | =end original |
921 | 921 | |
922 | 922 | 単純にこれを実行します: |
923 | 923 | |
924 | 924 | .../Porting/bisect.pl -e 'my $a := 2;' |
925 | 925 | |
926 | 926 | =begin original |
927 | 927 | |
928 | Using | |
928 | Using F<Porting/bisect.pl>, with one command (and no other files) it's easy to | |
929 | out | |
929 | find out | |
930 | 930 | |
931 | 931 | =end original |
932 | 932 | |
933 | ||
933 | F<Porting/bisect.pl> を (他のファイルなしで) 一つのコマンドで使うことで、 | |
934 | 934 | 次のものを簡単に見つけられます: |
935 | 935 | |
936 | 936 | =over 4 |
937 | 937 | |
938 | 938 | =item * |
939 | 939 | |
940 | 940 | =begin original |
941 | 941 | |
942 | 942 | Which commit caused this example code to break? |
943 | 943 | |
944 | 944 | =end original |
945 | 945 | |
946 | 946 | どのコミットがこの例のコードを壊しているか |
947 | 947 | |
948 | 948 | =item * |
949 | 949 | |
950 | 950 | =begin original |
951 | 951 | |
952 | 952 | Which commit caused this example code to start working? |
953 | 953 | |
954 | 954 | =end original |
955 | 955 | |
956 | 956 | どのコミットからこの例のコードが動作し始めているか |
957 | 957 | |
958 | 958 | =item * |
959 | 959 | |
960 | 960 | =begin original |
961 | 961 | |
962 | 962 | Which commit added the first file to match this regex? |
963 | 963 | |
964 | 964 | =end original |
965 | 965 | |
966 | 966 | どのコミットが最初にこの正規表現にマッチングするファイルを追加したか |
967 | 967 | |
968 | 968 | =item * |
969 | 969 | |
970 | 970 | =begin original |
971 | 971 | |
972 | 972 | Which commit removed the last file to match this regex? |
973 | 973 | |
974 | 974 | =end original |
975 | 975 | |
976 | 976 | どのコミットが最後にこの正規表現にマッチングするファイルを削除したか |
977 | 977 | |
978 | 978 | =back |
979 | 979 | |
980 | 980 | =begin original |
981 | 981 | |
982 | 982 | usually without needing to know which versions of perl to use as start and |
983 | end revisions, as F<bisect.pl> automatically searches to find the | |
983 | end revisions, as F<Porting/bisect.pl> automatically searches to find the | |
984 | stable version for which the test case passes. Run | |
984 | earliest stable version for which the test case passes. Run | |
985 | 985 | C<Porting/bisect.pl --help> for the full documentation, including how to |
986 | 986 | set the C<Configure> and build time options. |
987 | 987 | |
988 | 988 | =end original |
989 | 989 | |
990 | 990 | 通常はどのバージョンの perl を使うかの始点と終点のリビジョンを |
991 | 知っている必要はありません; | |
991 | 知っている必要はありません; F<Porting/bisect.pl> は自動的に、 | |
992 | ||
992 | テストケースが通過する最初の安定版バージョンを探します。 | |
993 | 探します。 | |
994 | 993 | C<Configure> とビルド時オプションを含む完全な文書を見るには |
995 | 994 | C<Porting/bisect.pl --help> を実行してください。 |
996 | 995 | |
997 | 996 | =begin original |
998 | 997 | |
999 | 998 | If you require more flexibility than F<Porting/bisect.pl> has to offer, you'll |
1000 | 999 | need to run C<git bisect> yourself. It's most useful to use C<git bisect run> |
1001 | 1000 | to automate the building and testing of perl revisions. For this you'll need |
1002 | 1001 | a shell script for C<git> to call to test a particular revision. An example |
1003 | 1002 | script is F<Porting/bisect-example.sh>, which you should copy B<outside> of |
1004 | 1003 | the repository, as the bisect process will reset the state to a clean checkout |
1005 | 1004 | as it runs. The instructions below assume that you copied it as F<~/run> and |
1006 | 1005 | then edited it as appropriate. |
1007 | 1006 | |
1008 | 1007 | =end original |
1009 | 1008 | |
1010 | 1009 | F<Porting/bisect.pl> が提供しているものよりもさらに柔軟性が必要な場合、 |
1011 | 1010 | C<git bisect> を自分自身で実行する必要があります。 |
1012 | 1011 | perl リビジョンのビルドとテストを自動化するために |
1013 | 1012 | C<git bisect run> を使うのが最も便利です。 |
1014 | 1013 | このために、特定のリビジョンをテストするために呼び出すための |
1015 | 1014 | C<git> のためのシェルスクリプトが必要です。 |
1016 | 1015 | 例のスクリプトは F<Porting/bisect-example.sh> で、 |
1017 | 1016 | これはリポジトリの B<外側> にコピーするべきです; |
1018 | 1017 | bisect 処理は、実行されるとクリーンなチェックアウトのために |
1019 | 1018 | 状態をリセットするからです。 |
1020 | 1019 | 後述の説明は、スクリプトを F<~/run> としてコピーして、それを |
1021 | 1020 | 適切に編集することを仮定しています。 |
1022 | 1021 | |
1023 | 1022 | =begin original |
1024 | 1023 | |
1025 | 1024 | You first enter in bisect mode with: |
1026 | 1025 | |
1027 | 1026 | =end original |
1028 | 1027 | |
1029 | 1028 | まず bisect モードに入ります: |
1030 | 1029 | |
1031 | 1030 | % git bisect start |
1032 | 1031 | |
1033 | 1032 | =begin original |
1034 | 1033 | |
1035 | 1034 | For example, if the bug is present on C<HEAD> but wasn't in 5.10.0, |
1036 | 1035 | C<git> will learn about this when you enter: |
1037 | 1036 | |
1038 | 1037 | =end original |
1039 | 1038 | |
1040 | 1039 | 例えば、バグが C<HEAD> にあっても 5.10.0 にはなかった場合、C<git> は |
1041 | 1040 | 以下のように入力することでこれを学習します: |
1042 | 1041 | |
1043 | 1042 | % git bisect bad |
1044 | 1043 | % git bisect good perl-5.10.0 |
1045 | 1044 | Bisecting: 853 revisions left to test after this |
1046 | 1045 | |
1047 | 1046 | =begin original |
1048 | 1047 | |
1049 | 1048 | This results in checking out the median commit between C<HEAD> and |
1050 | 1049 | C<perl-5.10.0>. You can then run the bisecting process with: |
1051 | 1050 | |
1052 | 1051 | =end original |
1053 | 1052 | |
1054 | 1053 | この結果、C<HEAD> と C<perl-5.10.0> の中間のコミットが |
1055 | 1054 | チェックアウトされます。 |
1056 | 1055 | 次のようにして bisect 処理を実行します: |
1057 | 1056 | |
1058 | 1057 | % git bisect run ~/run |
1059 | 1058 | |
1060 | 1059 | =begin original |
1061 | 1060 | |
1062 | 1061 | When the first bad commit is isolated, C<git bisect> will tell you so: |
1063 | 1062 | |
1064 | 1063 | =end original |
1065 | 1064 | |
1066 | 1065 | 最初の不正なコミットが分離されると、C<git bisect> は次のように言います: |
1067 | 1066 | |
1068 | 1067 | ca4cfd28534303b82a216cfe83a1c80cbc3b9dc5 is first bad commit |
1069 | 1068 | commit ca4cfd28534303b82a216cfe83a1c80cbc3b9dc5 |
1070 | 1069 | Author: Dave Mitchell <davem@fdisolutions.com> |
1071 | 1070 | Date: Sat Feb 9 14:56:23 2008 +0000 |
1072 | 1071 | |
1073 | 1072 | [perl #49472] Attributes + Unknown Error |
1074 | 1073 | ... |
1075 | 1074 | |
1076 | 1075 | bisect run success |
1077 | 1076 | |
1078 | 1077 | =begin original |
1079 | 1078 | |
1080 | 1079 | You can peek into the bisecting process with C<git bisect log> and |
1081 | 1080 | C<git bisect visualize>. C<git bisect reset> will get you out of bisect |
1082 | 1081 | mode. |
1083 | 1082 | |
1084 | 1083 | =end original |
1085 | 1084 | |
1086 | 1085 | C<git bisect log> と C<git bisect visualize> で bisect 処理を |
1087 | 1086 | 覗き見ることができます。 |
1088 | 1087 | C<git bisect reset>は bisect モードを解除します。 |
1089 | 1088 | |
1090 | 1089 | =begin original |
1091 | 1090 | |
1092 | 1091 | Please note that the first C<good> state must be an ancestor of the |
1093 | 1092 | first C<bad> state. If you want to search for the commit that I<solved> |
1094 | 1093 | some bug, you have to negate your test case (i.e. exit with C<1> if OK |
1095 | 1094 | and C<0> if not) and still mark the lower bound as C<good> and the |
1096 | 1095 | upper as C<bad>. The "first bad commit" has then to be understood as |
1097 | 1096 | the "first commit where the bug is solved". |
1098 | 1097 | |
1099 | 1098 | =end original |
1100 | 1099 | |
1101 | 1100 | 最初の C<good> 状態は、最初の C<bad> 状態の祖先である必要があることに |
1102 | 1101 | 注意してください。 |
1103 | 1102 | 何らかのバグを I<解決した> コミットを検索したい場合は、テストケースを |
1104 | 1103 | 反転させ、 |
1105 | 1104 | (つまり、OK なら C<1> で終了し、そうでないなら C<0> で終了する)、 |
1106 | 1105 | 下限を C<good>、上限を C<bad> とマークする必要があります。 |
1107 | 1106 | 「最初の不正なコミット」は、「バグが解決された最初のコミット」と |
1108 | 1107 | 解釈する必要があります。 |
1109 | 1108 | |
1110 | 1109 | =begin original |
1111 | 1110 | |
1112 | 1111 | C<git help bisect> has much more information on how you can tweak your |
1113 | 1112 | binary searches. |
1114 | 1113 | |
1115 | 1114 | =end original |
1116 | 1115 | |
1117 | 1116 | C<git help bisect> には、二分探索を微調整する方法に関する情報が豊富に |
1118 | 1117 | 用意されています。 |
1119 | 1118 | |
1120 | =head | |
1119 | =head2 Topic branches and rewriting history | |
1121 | 1120 | |
1122 | 1121 | (トピックブランチと履歴の書き換え) |
1123 | 1122 | |
1124 | 1123 | =begin original |
1125 | 1124 | |
1126 | 1125 | Individual committers should create topic branches under |
1127 | B<yourname>/B<some_descriptive_name> | |
1126 | B<yourname>/B<some_descriptive_name>: | |
1128 | with a topic branch's creator before making any change to it. | |
1129 | 1127 | |
1130 | 1128 | =end original |
1131 | 1129 | |
1132 | 1130 | 個々のコミッターは、B<yourname>/B<some_descriptive_name> |
1133 | の下にトピックブランチを作成する必要があります | |
1131 | の下にトピックブランチを作成する必要があります: | |
1134 | 他のコミッターは、トピックブランチに変更を加える前に、その作成者に | |
1135 | 確認する必要があります。 | |
1136 | 1132 | |
1133 | % branch="$yourname/$some_descriptive_name" | |
1134 | % git checkout -b $branch | |
1135 | ... do local edits, commits etc ... | |
1136 | % git push origin -u $branch | |
1137 | ||
1137 | 1138 | =begin original |
1138 | 1139 | |
1139 | ||
1140 | Should you be stuck with an ancient version of git (prior to 1.7), then | |
1140 | ||
1141 | C<git push> will not have the C<-u> switch, and you have to replace the | |
1141 | ||
1142 | last step with the following sequence: | |
1142 | 1143 | |
1143 | 1144 | =end original |
1144 | 1145 | |
1145 | ||
1146 | とても古いバージョン (1.7 より前) の git をまだ使っている場合、 | |
1146 | ||
1147 | C<git push> には C<-u> オプションがありません; | |
1147 | ||
1148 | 最後の手順を次のもので置き換える必要があります: | |
1148 | 1149 | |
1149 | | |
1150 | % git push origin $branch:refs/heads/$branch | |
1150 | | |
1151 | % git config branch.$branch.remote origin | |
1151 | | |
1152 | % git config branch.$branch.merge refs/heads/$branch | |
1152 | 1153 | |
1153 | 1154 | =begin original |
1154 | 1155 | |
1155 | ||
1156 | If you want to make changes to someone else's topic branch, you should | |
1157 | check with its creator before making any change to it. | |
1156 | 1158 | |
1157 | 1159 | =end original |
1158 | 1160 | |
1159 | ||
1161 | 他の人のトピックブランチを変更したい場合、変更する前に | |
1162 | その作成者に確認する必要があります。 | |
1160 | 1163 | |
1161 | $ branch="$yourname/$some_descriptive_name" | |
1162 | $ git checkout -b $branch | |
1163 | $ git push origin -u $branch | |
1164 | ||
1165 | 1164 | =begin original |
1166 | 1165 | |
1167 | ||
1166 | You | |
1168 | 1167 | might sometimes find that the original author has edited the branch's |
1169 | 1168 | history. There are lots of good reasons for this. Sometimes, an author |
1170 | 1169 | might simply be rebasing the branch onto a newer source point. |
1171 | 1170 | Sometimes, an author might have found an error in an early commit which |
1172 | 1171 | they wanted to fix before merging the branch to blead. |
1173 | 1172 | |
1174 | 1173 | =end original |
1175 | 1174 | |
1176 | ||
1175 | 元の作成者がブランチの履歴を編集したことに気付くことがあります。 | |
1177 | ブランチの履歴を編集したことに気付くことがあります。 | |
1178 | 1176 | これには多くの正当な理由があります。 |
1179 | 1177 | 場合によっては、単にブランチを新しいソースポイントに基づいて |
1180 | 1178 | 作り直すことになることもあります。 |
1181 | 1179 | 場合によっては、ブランチを blead にマージする前に、 |
1182 | 1180 | 初期のコミットで修正したいエラーを見つけたこともあります。 |
1183 | 1181 | |
1184 | 1182 | =begin original |
1185 | 1183 | |
1186 | 1184 | Currently the master repository is configured to forbid |
1187 | 1185 | non-fast-forward merges. This means that the branches within can not be |
1188 | 1186 | rebased and pushed as a single step. |
1189 | 1187 | |
1190 | 1188 | =end original |
1191 | 1189 | |
1192 | 1190 | 現在、マスターリポジトリは、非 fast-forward のマージを禁止するように |
1193 | 1191 | 構成されています。 |
1194 | 1192 | これは、中のブランチはリベースとプッシュを単一ステップとしては |
1195 | 1193 | できないことを意味します。 |
1196 | 1194 | |
1197 | 1195 | =begin original |
1198 | 1196 | |
1199 | 1197 | The only way you will ever be allowed to rebase or modify the history |
1200 | 1198 | of a pushed branch is to delete it and push it as a new branch under |
1201 | 1199 | the same name. Please think carefully about doing this. It may be |
1202 | 1200 | better to sequentially rename your branches so that it is easier for |
1203 | 1201 | others working with you to cherry-pick their local changes onto the new |
1204 | 1202 | version. (XXX: needs explanation). |
1205 | 1203 | |
1206 | 1204 | =end original |
1207 | 1205 | |
1208 | 1206 | プッシュされたブランチの履歴を再取得または変更する唯一の方法は、 |
1209 | 1207 | そのブランチを削除し、同じ名前で新しいブランチとしてプッシュすることです。 |
1210 | 1208 | これを行うことについては慎重に検討してください。 |
1211 | 1209 | 他のユーザーが新しいバージョンにローカルの変更を簡単に |
1212 | 1210 | チェリーピックできるように、 |
1213 | 1211 | ブランチの名前を順番に変更した方がよい場合があります(XXX:説明が必要)。 |
1214 | 1212 | |
1215 | 1213 | =begin original |
1216 | 1214 | |
1217 | 1215 | If you want to rebase a personal topic branch, you will have to delete |
1218 | 1216 | your existing topic branch and push as a new version of it. You can do |
1219 | 1217 | this via the following formula (see the explanation about C<refspec>'s |
1220 | 1218 | in the git push documentation for details) after you have rebased your |
1221 | 1219 | branch: |
1222 | 1220 | |
1223 | 1221 | =end original |
1224 | 1222 | |
1225 | 1223 | 個人的なトピックブランチをリベースしたい場合は、 |
1226 | 1224 | 既存のトピックブランチを削除し、新しいバージョンとして |
1227 | 1225 | プッシュする必要があります。 |
1228 | 1226 | これは、ブランチをリベースした後、次の公式 |
1229 | 1227 | (詳細は git push 文書の C<refspec> に関する説明を参照)で行うことができます。 |
1230 | 1228 | |
1231 | | |
1229 | # first rebase | |
1232 | | |
1230 | % git checkout $user/$topic | |
1233 | | |
1231 | % git fetch | |
1234 | | |
1232 | % git rebase origin/blead | |
1235 | 1233 | |
1236 | | |
1234 | # then "delete-and-push" | |
1237 | | |
1235 | % git push origin :$user/$topic | |
1238 | | |
1236 | % git push origin $user/$topic | |
1239 | 1237 | |
1240 | 1238 | =begin original |
1241 | 1239 | |
1242 | 1240 | B<NOTE:> it is forbidden at the repository level to delete any of the |
1243 | 1241 | "primary" branches. That is any branch matching |
1244 | 1242 | C<m!^(blead|maint|perl)!>. Any attempt to do so will result in git |
1245 | 1243 | producing an error like this: |
1246 | 1244 | |
1247 | 1245 | =end original |
1248 | 1246 | |
1249 | 1247 | B<注意:> リポジトリレベルで"プライマリ"ブランチを削除することは |
1250 | 1248 | 禁止されています。 |
1251 | 1249 | これは C<m!^(blead maint perl)!> にマッチングするブランチです。 |
1252 | 1250 | 削除しようとすると、gitは次のようなエラーを生成します: |
1253 | 1251 | |
1254 | | |
1252 | % git push origin :blead | |
1255 | | |
1253 | *** It is forbidden to delete blead/maint branches in this repository | |
1256 | | |
1254 | error: hooks/update exited with error code 1 | |
1257 | | |
1255 | error: hook declined to update refs/heads/blead | |
1258 | | |
1256 | To ssh://perl5.git.perl.org/perl | |
1259 | | |
1257 | ! [remote rejected] blead (hook declined) | |
1260 | | |
1258 | error: failed to push some refs to 'ssh://perl5.git.perl.org/perl' | |
1261 | 1259 | |
1262 | 1260 | =begin original |
1263 | 1261 | |
1264 | 1262 | As a matter of policy we do B<not> edit the history of the blead and |
1265 | 1263 | maint-* branches. If a typo (or worse) sneaks into a commit to blead or |
1266 | 1264 | maint-*, we'll fix it in another commit. The only types of updates |
1267 | allowed on these branches are "fast-forward | |
1265 | allowed on these branches are "fast-forwards", where all history is | |
1268 | 1266 | preserved. |
1269 | 1267 | |
1270 | 1268 | =end original |
1271 | 1269 | |
1272 | 1270 | ポリシーとして、blead ブランチと maint-* ブランチの履歴は編集 B<しません>。 |
1273 | 1271 | タイプミス(またはそれ以上)が blead または maint-* へのコミットに |
1274 | 1272 | 忍び込んだ場合は、別のコミットで修正します。 |
1275 | 1273 | これらのブランチで許可されている更新のタイプは "fast-forward" だけで、 |
1276 | 1274 | すべての履歴が保存されます。 |
1277 | 1275 | |
1278 | 1276 | =begin original |
1279 | 1277 | |
1280 | 1278 | Annotated tags in the canonical perl.git repository will never be |
1281 | 1279 | deleted or modified. Think long and hard about whether you want to push |
1282 | a local tag to perl.git before doing so. (Pushing | |
1280 | a local tag to perl.git before doing so. (Pushing simple tags is | |
1283 | 1281 | not allowed.) |
1284 | 1282 | |
1285 | 1283 | =end original |
1286 | 1284 | |
1287 | 1285 | 標準的な perl.git リポジトリ内の注釈付きタグは、削除や |
1288 | 1286 | 変更されることはありません。 |
1289 | 1287 | ローカルタグを perl.git にプッシュする前に、じっくり考えてみてください |
1290 | ( | |
1288 | (単純タグのプッシュは許可されていません)。 | |
1291 | 1289 | |
1292 | 1290 | =head2 Grafts |
1293 | 1291 | |
1294 | 1292 | (接ぎ木) |
1295 | 1293 | |
1296 | 1294 | =begin original |
1297 | 1295 | |
1298 | 1296 | The perl history contains one mistake which was not caught in the |
1299 | 1297 | conversion: a merge was recorded in the history between blead and |
1300 | 1298 | maint-5.10 where no merge actually occurred. Due to the nature of git, |
1301 | 1299 | this is now impossible to fix in the public repository. You can remove |
1302 | 1300 | this mis-merge locally by adding the following line to your |
1303 | 1301 | C<.git/info/grafts> file: |
1304 | 1302 | |
1305 | 1303 | =end original |
1306 | 1304 | |
1307 | 1305 | Perl履歴には、変換で検出されなかった誤りが一つ含まれています: |
1308 | 1306 | blead と maint-5.10 の間の履歴にマージが記録されましたが、 |
1309 | 1307 | 実際にはマージは発生しませんでした。 |
1310 | 1308 | git の性質上、パブリックリポジトリで修正することは現在不可能です。 |
1311 | 1309 | C<.git/info/graft> ファイルに次の行を追加することで、 |
1312 | 1310 | この誤ったマージをローカルで削除できます。 |
1313 | 1311 | |
1314 | | |
1312 | 296f12bbbbaa06de9be9d09d3dcf8f4528898a49 434946e0cb7a32589ed92d18008aaa1d88515930 | |
1315 | 1313 | |
1316 | 1314 | =begin original |
1317 | 1315 | |
1318 | 1316 | It is particularly important to have this graft line if any bisecting |
1319 | 1317 | is done in the area of the "merge" in question. |
1320 | 1318 | |
1321 | 1319 | =end original |
1322 | 1320 | |
1323 | 1321 | 問題の「マージ」領域で bisect が行われる場合、この graft 行を |
1324 | 1322 | 指定することが特に重要です。 |
1325 | 1323 | |
1326 | 1324 | =head1 WRITE ACCESS TO THE GIT REPOSITORY |
1327 | 1325 | |
1328 | 1326 | (git リポジトリへの書き込みアクセス) |
1329 | 1327 | |
1330 | 1328 | =begin original |
1331 | 1329 | |
1332 | 1330 | Once you have write access, you will need to modify the URL for the |
1333 | 1331 | origin remote to enable pushing. Edit F<.git/config> with the |
1334 | 1332 | git-config(1) command: |
1335 | 1333 | |
1336 | 1334 | =end original |
1337 | 1335 | |
1338 | 1336 | 一旦書き込み権限を得たら、 |
1339 | 1337 | プッシュを有効にするために origin remote のための URL を |
1340 | 1338 | 変更する必要があります。 |
1341 | 1339 | git-config(1) コマンドで F<.git/config> を次のように編集します: |
1342 | 1340 | |
1343 | 1341 | % git config remote.origin.url ssh://perl5.git.perl.org/perl.git |
1344 | 1342 | |
1345 | 1343 | =begin original |
1346 | 1344 | |
1347 | 1345 | You can also set up your user name and e-mail address. Most people do |
1348 | 1346 | this once globally in their F<~/.gitconfig> by doing something like: |
1349 | 1347 | |
1350 | 1348 | =end original |
1351 | 1349 | |
1352 | 1350 | ユーザー名と電子メールアドレスを設定することもできます。 |
1353 | 1351 | ほとんどの人は、以下のようにすることで F<~/.gitconfig> でグローバルに |
1354 | 1352 | 一度これを行います: |
1355 | 1353 | |
1356 | 1354 | % git config --global user.name "Ævar Arnfjörð Bjarmason" |
1357 | 1355 | % git config --global user.email avarab@gmail.com |
1358 | 1356 | |
1359 | 1357 | =begin original |
1360 | 1358 | |
1361 | However if you'd like to override that just for perl | |
1359 | However, if you'd like to override that just for perl, | |
1362 | 1360 | execute something like the following in F<perl>: |
1363 | 1361 | |
1364 | 1362 | =end original |
1365 | 1363 | |
1366 | 1364 | しかし、perl だけに対してこれを変更したい場合は、 |
1367 | 1365 | F<perl> で次のようなものを実行します: |
1368 | 1366 | |
1369 | 1367 | % git config user.email avar@cpan.org |
1370 | 1368 | |
1371 | 1369 | =begin original |
1372 | 1370 | |
1373 | 1371 | It is also possible to keep C<origin> as a git remote, and add a new |
1374 | 1372 | remote for ssh access: |
1375 | 1373 | |
1376 | 1374 | =end original |
1377 | 1375 | |
1378 | 1376 | C<origin> を git remote として維持し、ssh アクセス用の新しい remote を |
1379 | 1377 | 追加することも可能です: |
1380 | 1378 | |
1381 | 1379 | % git remote add camel perl5.git.perl.org:/perl.git |
1382 | 1380 | |
1383 | 1381 | =begin original |
1384 | 1382 | |
1385 | 1383 | This allows you to update your local repository by pulling from |
1386 | 1384 | C<origin>, which is faster and doesn't require you to authenticate, and |
1387 | 1385 | to push your changes back with the C<camel> remote: |
1388 | 1386 | |
1389 | 1387 | =end original |
1390 | 1388 | |
1391 | 1389 | これにより、C<origin> からプルしてローカルリポジトリを更新できます; |
1392 | 1390 | これはより高速で、認証を必要としません; |
1393 | 1391 | また、C<camel> リモートで変更をプッシュバックすることもできます。 |
1394 | 1392 | |
1395 | 1393 | % git fetch camel |
1396 | 1394 | % git push camel |
1397 | 1395 | |
1398 | 1396 | =begin original |
1399 | 1397 | |
1400 | 1398 | The C<fetch> command just updates the C<camel> refs, as the objects |
1401 | 1399 | themselves should have been fetched when pulling from C<origin>. |
1402 | 1400 | |
1403 | 1401 | =end original |
1404 | 1402 | |
1405 | 1403 | C<fetch> コマンドは単に C<camel> refs を更新するだけです; |
1406 | 1404 | なぜなら、オブジェクト自体は C<origin> からプルするときに |
1407 | 1405 | フェッチされるべきだからです。 |
1408 | 1406 | |
1409 | =head | |
1407 | =head2 Accepting a patch | |
1410 | 1408 | |
1411 | 1409 | (パッチを受け入れる) |
1412 | 1410 | |
1413 | 1411 | =begin original |
1414 | 1412 | |
1415 | 1413 | If you have received a patch file generated using the above section, |
1416 | 1414 | you should try out the patch. |
1417 | 1415 | |
1418 | 1416 | =end original |
1419 | 1417 | |
1420 | 1418 | 前述の節でを使って生成されたパッチファイルを受け取った場合は、 |
1421 | 1419 | パッチを試してみてください。 |
1422 | 1420 | |
1423 | 1421 | =begin original |
1424 | 1422 | |
1425 | 1423 | First we need to create a temporary new branch for these changes and |
1426 | 1424 | switch into it: |
1427 | 1425 | |
1428 | 1426 | =end original |
1429 | 1427 | |
1430 | 1428 | まず、これらの変更のための一時的な新しいブランチを作成し、そのブランチに |
1431 | 1429 | 切り替える必要があります: |
1432 | 1430 | |
1433 | | |
1431 | % git checkout -b experimental | |
1434 | 1432 | |
1435 | 1433 | =begin original |
1436 | 1434 | |
1437 | 1435 | Patches that were formatted by C<git format-patch> are applied with |
1438 | 1436 | C<git am>: |
1439 | 1437 | |
1440 | 1438 | =end original |
1441 | 1439 | |
1442 | 1440 | C<git format-patch> でフォーマットされたパッチは、C<git am> で適用されます: |
1443 | 1441 | |
1444 | | |
1442 | % git am 0001-Rename-Leon-Brocard-to-Orange-Brocard.patch | |
1445 | | |
1443 | Applying Rename Leon Brocard to Orange Brocard | |
1446 | 1444 | |
1447 | 1445 | =begin original |
1448 | 1446 | |
1447 | Note that some UNIX mail systems can mess with text attachments containing | |
1448 | 'From '. This will fix them up: | |
1449 | ||
1450 | =end original | |
1451 | ||
1452 | 一部の UNIX メールシステムは、添付テキストに 'From ' が含まれていると | |
1453 | おかしくなるかもしれないことに注意してください。 | |
1454 | これは次のようにして修正します: | |
1455 | ||
1456 | % perl -pi -e's/^>From /From /' \ | |
1457 | 0001-Rename-Leon-Brocard-to-Orange-Brocard.patch | |
1458 | ||
1459 | =begin original | |
1460 | ||
1449 | 1461 | If just a raw diff is provided, it is also possible use this two-step |
1450 | 1462 | process: |
1451 | 1463 | |
1452 | 1464 | =end original |
1453 | 1465 | |
1454 | 1466 | 生の diff だけが提供されている場合は、次の 2 段階のプロセスを |
1455 | 1467 | 使用することもできます: |
1456 | 1468 | |
1457 | | |
1469 | % git apply bugfix.diff | |
1458 | | |
1470 | % git commit -a -m "Some fixing" \ | |
1471 | --author="That Guy <that.guy@internets.com>" | |
1459 | 1472 | |
1460 | 1473 | =begin original |
1461 | 1474 | |
1462 | 1475 | Now we can inspect the change: |
1463 | 1476 | |
1464 | 1477 | =end original |
1465 | 1478 | |
1466 | 1479 | ここで変更を検査できます: |
1467 | 1480 | |
1468 | | |
1481 | % git show HEAD | |
1469 | | |
1482 | commit b1b3dab48344cff6de4087efca3dbd63548ab5e2 | |
1470 | | |
1483 | Author: Leon Brocard <acme@astray.com> | |
1471 | | |
1484 | Date: Fri Dec 19 17:02:59 2008 +0000 | |
1472 | 1485 | |
1473 | | |
1486 | Rename Leon Brocard to Orange Brocard | |
1474 | 1487 | |
1475 | | |
1488 | diff --git a/AUTHORS b/AUTHORS | |
1476 | | |
1489 | index 293dd70..722c93e 100644 | |
1477 | | |
1490 | --- a/AUTHORS | |
1478 | | |
1491 | +++ b/AUTHORS | |
1479 | | |
1492 | @@ -541,7 +541,7 @@ Lars Hecking <lhecking@nmrc.ucc.ie> | |
1480 | | |
1493 | Laszlo Molnar <laszlo.molnar@eth.ericsson.se> | |
1481 | | |
1494 | Leif Huhn <leif@hale.dkstat.com> | |
1482 | | |
1495 | Len Johnson <lenjay@ibm.net> | |
1483 | | |
1496 | -Leon Brocard <acme@astray.com> | |
1484 | | |
1497 | +Orange Brocard <acme@astray.com> | |
1485 | | |
1498 | Les Peters <lpeters@aol.net> | |
1486 | | |
1499 | Lesley Binks <lesley.binks@gmail.com> | |
1487 | | |
1500 | Lincoln D. Stein <lstein@cshl.org> | |
1488 | 1501 | |
1489 | 1502 | =begin original |
1490 | 1503 | |
1491 | 1504 | If you are a committer to Perl and you think the patch is good, you can |
1492 | 1505 | then merge it into blead then push it out to the main repository: |
1493 | 1506 | |
1494 | 1507 | =end original |
1495 | 1508 | |
1496 | 1509 | もしあなたが Perl のコミッタで、パッチが良いものだと思うなら、 |
1497 | 1510 | それを blead にマージしてメインのリポジトリにプッシュすることができます: |
1498 | 1511 | |
1499 | 1512 | % git checkout blead |
1500 | 1513 | % git merge experimental |
1501 | % git push | |
1514 | % git push origin blead | |
1502 | 1515 | |
1503 | 1516 | =begin original |
1504 | 1517 | |
1505 | 1518 | If you want to delete your temporary branch, you may do so with: |
1506 | 1519 | |
1507 | 1520 | =end original |
1508 | 1521 | |
1509 | 1522 | 一時的なブランチを削除したいなら、以下のようにできます: |
1510 | 1523 | |
1511 | | |
1524 | % git checkout blead | |
1512 | | |
1525 | % git branch -d experimental | |
1513 | | |
1526 | error: The branch 'experimental' is not an ancestor of your current | |
1514 | If you are sure you want to delete it, run 'git branch -D | |
1527 | HEAD. If you are sure you want to delete it, run 'git branch -D | |
1515 | | |
1528 | experimental'. | |
1516 | | |
1529 | % git branch -D experimental | |
1530 | Deleted branch experimental. | |
1517 | 1531 | |
1518 | 1532 | =head2 Committing to blead |
1519 | 1533 | |
1520 | 1534 | (blead にコミットする) |
1521 | 1535 | |
1522 | 1536 | =begin original |
1523 | 1537 | |
1524 | 1538 | The 'blead' branch will become the next production release of Perl. |
1525 | 1539 | |
1526 | 1540 | =end original |
1527 | 1541 | |
1528 | 1542 | 'blead' ブランチは、Perl の次の正式版リリースになります。 |
1529 | 1543 | |
1530 | 1544 | =begin original |
1531 | 1545 | |
1532 | 1546 | Before pushing I<any> local change to blead, it's incredibly important |
1533 | 1547 | that you do a few things, lest other committers come after you with |
1534 | 1548 | pitchforks and torches: |
1535 | 1549 | |
1536 | 1550 | =end original |
1537 | 1551 | |
1538 | 1552 | I<何らかの> ローカルな変更をプッシュする前に、 |
1539 | 1553 | あなたの後から来る他のコミッタが熊手と松明を持ってこないように、 |
1540 | 1554 | いくつかのことをするのが極めて重要です: |
1541 | 1555 | |
1542 | 1556 | =over |
1543 | 1557 | |
1544 | 1558 | =item * |
1545 | 1559 | |
1546 | 1560 | =begin original |
1547 | 1561 | |
1548 | 1562 | Make sure you have a good commit message. See L<perlhack/Commit |
1549 | 1563 | message> for details. |
1550 | 1564 | |
1551 | 1565 | =end original |
1552 | 1566 | |
1553 | 1567 | よいコミットメッセージを書くようにしてください。 |
1554 | 1568 | 詳しくは L<perlhack/Commit message> を参照してください。 |
1555 | 1569 | |
1556 | 1570 | =item * |
1557 | 1571 | |
1558 | 1572 | =begin original |
1559 | 1573 | |
1560 | 1574 | Run the test suite. You might not think that one typo fix would break a |
1561 | 1575 | test file. You'd be wrong. Here's an example of where not running the |
1562 | 1576 | suite caused problems. A patch was submitted that added a couple of |
1563 | tests to an existing .t. It couldn't possibly affect anything else, so | |
1577 | tests to an existing F<.t>. It couldn't possibly affect anything else, so | |
1564 | no need to test beyond the single affected .t, right? But, the | |
1578 | no need to test beyond the single affected F<.t>, right? But, the | |
1565 | 1579 | submitter's email address had changed since the last of their |
1566 | 1580 | submissions, and this caused other tests to fail. Running the test |
1567 | 1581 | target given in the next item would have caught this problem. |
1568 | 1582 | |
1569 | 1583 | =end original |
1570 | 1584 | |
1571 | 1585 | テストスイートを実行します。 |
1572 | 1586 | 一つのタイプミス修正がテストファイルを壊すとは思わないかもしれません。 |
1573 | 1587 | それは間違いです。 |
1574 | 1588 | スイートを実行しないと問題が発生する例を次に示します。 |
1575 | 既存の .t にいくつかのテストを追加するパッチが提出されました。 | |
1589 | 既存の F<.t> にいくつかのテストを追加するパッチが提出されました。 | |
1576 | 1590 | 他の何にも影響する可能性はないので、 |
1577 | 影響を受けた一つ以上をテストする必要はありません。 | |
1591 | 影響を受けた一つの F<.t> 以上をテストする必要はありません。 | |
1578 | 1592 | そうですね? |
1579 | 1593 | しかし、送信者のメールアドレスが前回の送信時から変更されていて、 |
1580 | 1594 | このための他のテストが失敗するようになりました。 |
1581 | 1595 | 次の項目のテストターゲットを実行すると、この問題を捕まえられます。 |
1582 | 1596 | |
1583 | 1597 | =item * |
1584 | 1598 | |
1585 | 1599 | =begin original |
1586 | 1600 | |
1587 | 1601 | If you don't run the full test suite, at least C<make test_porting>. |
1588 | 1602 | This will run basic sanity checks. To see which sanity checks, have a |
1589 | 1603 | look in F<t/porting>. |
1590 | 1604 | |
1591 | 1605 | =end original |
1592 | 1606 | |
1593 | 1607 | 完全なテストスイートを実行しない場合でも、 |
1594 | 1608 | 最低 C<make test_porting> は実行してください。 |
1595 | 1609 | これは基本的な正気チェックを実行します。 |
1596 | 1610 | どの正気チェックかを見るには、F<t/porting> を見てください。 |
1597 | 1611 | |
1598 | 1612 | =item * |
1599 | 1613 | |
1600 | 1614 | =begin original |
1601 | 1615 | |
1602 | 1616 | If you make any changes that affect miniperl or core routines that have |
1603 | 1617 | different code paths for miniperl, be sure to run C<make minitest>. |
1604 | 1618 | This will catch problems that even the full test suite will not catch |
1605 | 1619 | because it runs a subset of tests under miniperl rather than perl. |
1606 | 1620 | |
1607 | 1621 | =end original |
1608 | 1622 | |
1609 | 1623 | miniperl や miniperl のための異なるコードパスを持つコアルーチンに |
1610 | 1624 | 影響する変更を行う場合、C<make minitest> をするようにしてください。 |
1611 | 1625 | これは、perl ではなく miniperl でテストの一部を行うために完全な |
1612 | 1626 | テストスイートでは捕捉できない問題も捕捉します。 |
1613 | 1627 | |
1614 | 1628 | =back |
1615 | 1629 | |
1616 | =head | |
1630 | =head2 On merging and rebasing | |
1617 | 1631 | |
1618 | 1632 | (マージとリベース時) |
1619 | 1633 | |
1620 | 1634 | =begin original |
1621 | 1635 | |
1622 | 1636 | Simple, one-off commits pushed to the 'blead' branch should be simple |
1623 | 1637 | commits that apply cleanly. In other words, you should make sure your |
1624 | 1638 | work is committed against the current position of blead, so that you can |
1625 | 1639 | push back to the master repository without merging. |
1626 | 1640 | |
1627 | 1641 | =end original |
1628 | 1642 | |
1629 | 1643 | 'blead' ブランチにプッシュされた、単純な 1 回限りのコミットは、 |
1630 | 1644 | クリーンに適用される単純なコミットであるべきです。 |
1631 | 1645 | 言い換えると、作業したものは blead の現在の位置に対して |
1632 | 1646 | コミットすることで、マージすることなく master に |
1633 | 1647 | プッシュできるようにするべきです。 |
1634 | 1648 | |
1635 | 1649 | =begin original |
1636 | 1650 | |
1637 | 1651 | Sometimes, blead will move while you're building or testing your |
1638 | 1652 | changes. When this happens, your push will be rejected with a message |
1639 | 1653 | like this: |
1640 | 1654 | |
1641 | 1655 | =end original |
1642 | 1656 | |
1643 | 1657 | あなたが変更したものをビルドしたりテストしたりしている間に、 |
1644 | 1658 | 時々 blead は動きます。 |
1645 | 1659 | これが起きると、プッシュは次のようなメッセージで拒否されます: |
1646 | 1660 | |
1647 | | |
1661 | To ssh://perl5.git.perl.org/perl.git | |
1648 | | |
1662 | ! [rejected] blead -> blead (non-fast-forward) | |
1649 | | |
1663 | error: failed to push some refs to 'ssh://perl5.git.perl.org/perl.git' | |
1650 | | |
1664 | To prevent you from losing history, non-fast-forward updates were | |
1651 | Merge the remote changes (e.g. 'git pull') before pushing | |
1665 | rejected Merge the remote changes (e.g. 'git pull') before pushing | |
1652 | 'Note about fast-forwards' section of 'git push --help' | |
1666 | again. See the 'Note about fast-forwards' section of 'git push --help' | |
1667 | for details. | |
1653 | 1668 | |
1654 | 1669 | =begin original |
1655 | 1670 | |
1656 | 1671 | When this happens, you can just I<rebase> your work against the new |
1657 | 1672 | position of blead, like this (assuming your remote for the master |
1658 | 1673 | repository is "p5p"): |
1659 | 1674 | |
1660 | 1675 | =end original |
1661 | 1676 | |
1662 | 1677 | これが起きた場合、次のようにして、blead の新しい位置に対してあなたの作業を |
1663 | 1678 | 単に I<リベース> します (master リポジトリに対するあなたのリモート名を |
1664 | 1679 | "p5p" と仮定します): |
1665 | 1680 | |
1666 | | |
1681 | % git fetch p5p | |
1667 | | |
1682 | % git rebase p5p/blead | |
1668 | 1683 | |
1669 | 1684 | =begin original |
1670 | 1685 | |
1671 | 1686 | You will see your commits being re-applied, and you will then be able to |
1672 | 1687 | push safely. More information about rebasing can be found in the |
1673 | 1688 | documentation for the git-rebase(1) command. |
1674 | 1689 | |
1675 | 1690 | =end original |
1676 | 1691 | |
1677 | 1692 | コミットが再適用され、安全にプッシュできるようになります。 |
1678 | 1693 | リベースに関するさらなる情報は、git-rebase(1) コマンドの文書にあります。 |
1679 | 1694 | |
1680 | 1695 | =begin original |
1681 | 1696 | |
1682 | 1697 | For larger sets of commits that only make sense together, or that would |
1683 | 1698 | benefit from a summary of the set's purpose, you should use a merge |
1684 | 1699 | commit. You should perform your work on a L<topic branch|/Topic |
1685 | 1700 | branches and rewriting history>, which you should regularly rebase |
1686 | 1701 | against blead to ensure that your code is not broken by blead moving. |
1687 | 1702 | When you have finished your work, please perform a final rebase and |
1688 | 1703 | test. Linear history is something that gets lost with every |
1689 | 1704 | commit on blead, but a final rebase makes the history linear |
1690 | 1705 | again, making it easier for future maintainers to see what has |
1691 | 1706 | happened. Rebase as follows (assuming your work was on the |
1692 | 1707 | branch C<< committer/somework >>): |
1693 | 1708 | |
1694 | 1709 | =end original |
1695 | 1710 | |
1696 | 1711 | 一緒にすることでのみ意味がある、または集合の目的の要約としての |
1697 | 1712 | 価値があるような、より大きなコミットの集合に対しては、 |
1698 | 1713 | マージコミットを使うべきです。 |
1699 | 1714 | 作業は L<トピックブランチ|/Topic |
1700 | 1715 | branches and rewriting history> で行うべきです; |
1701 | 1716 | そして、blead の移動によってあなたのコードが壊れていないことを |
1702 | 1717 | 確認するために定期的に blead に対してリベースするべきです。 |
1703 | 1718 | 作業が終わったら、最後にリベースしてテストしてください。 |
1704 | 1719 | 線形の履歴は blead にコミットされる度に失われますが、 |
1705 | 1720 | 最後のリベースは再び履歴を線形にし、 |
1706 | 1721 | 将来の保守者が何が起きたのかを見るのをより容易にします。 |
1707 | 1722 | 次のようにしてリベースします (あなたの作業が |
1708 | 1723 | C<< committer/somework >> ブランチにあると仮定します): |
1709 | 1724 | |
1710 | | |
1725 | % git checkout committer/somework | |
1711 | | |
1726 | % git rebase blead | |
1712 | 1727 | |
1713 | 1728 | =begin original |
1714 | 1729 | |
1715 | 1730 | Then you can merge it into master like this: |
1716 | 1731 | |
1717 | 1732 | =end original |
1718 | 1733 | |
1719 | 1734 | それから次のようにして master にマージできます: |
1720 | 1735 | |
1721 | | |
1736 | % git checkout blead | |
1722 | | |
1737 | % git merge --no-ff --no-commit committer/somework | |
1723 | | |
1738 | % git commit -a | |
1724 | 1739 | |
1725 | 1740 | =begin original |
1726 | 1741 | |
1727 | 1742 | The switches above deserve explanation. C<--no-ff> indicates that even |
1728 | 1743 | if all your work can be applied linearly against blead, a merge commit |
1729 | 1744 | should still be prepared. This ensures that all your work will be shown |
1730 | 1745 | as a side branch, with all its commits merged into the mainstream blead |
1731 | 1746 | by the merge commit. |
1732 | 1747 | |
1733 | 1748 | =end original |
1734 | 1749 | |
1735 | 1750 | 前述のスイッチは説明が必要でしょう。 |
1736 | 1751 | C<--no-ff> は、たとえあなたの作業が blead に対して線形に適用可能でも、 |
1737 | 1752 | マージコミットが準備されることを示します。 |
1738 | 1753 | これによりあなたの作業は側道のブランチとして表示され、 |
1739 | 1754 | そのコミットはマージコミットによってメインの blead に |
1740 | 1755 | マージされることになります。 |
1741 | 1756 | |
1742 | 1757 | =begin original |
1743 | 1758 | |
1744 | 1759 | C<--no-commit> means that the merge commit will be I<prepared> but not |
1745 | 1760 | I<committed>. The commit is then actually performed when you run the |
1746 | 1761 | next command, which will bring up your editor to describe the commit. |
1747 | 1762 | Without C<--no-commit>, the commit would be made with nearly no useful |
1748 | 1763 | message, which would greatly diminish the value of the merge commit as a |
1749 | 1764 | placeholder for the work's description. |
1750 | 1765 | |
1751 | 1766 | =end original |
1752 | 1767 | |
1753 | 1768 | C<--no-commit> は、マージコミットは I<準備> はされますが |
1754 | 1769 | I<コミット> はされないことを意味します。 |
1755 | 1770 | コミットは実際には次のコマンドを実行して、 |
1756 | 1771 | コミットの説明のためにエディタが起動した後に実行されます。 |
1757 | 1772 | C<--no-commit> なしの場合、 |
1758 | 1773 | 有用なメッセージなしでコミットが行われます; |
1759 | 1774 | これは作業の説明のためのプレースホルダとしてマージコミットの価値を |
1760 | 1775 | 大幅に減らしてしまいます。 |
1761 | 1776 | |
1762 | 1777 | =begin original |
1763 | 1778 | |
1764 | 1779 | When describing the merge commit, explain the purpose of the branch, and |
1765 | 1780 | keep in mind that this description will probably be used by the |
1766 | 1781 | eventual release engineer when reviewing the next perldelta document. |
1767 | 1782 | |
1768 | 1783 | =end original |
1769 | 1784 | |
1770 | 1785 | マージコミットの説明を書くとき、 |
1771 | 1786 | このブランチの目的を説明してください; |
1772 | 1787 | そしてこの説明はおそらく次の perldelta 文書をレビューするときに |
1773 | 1788 | 最終的なリリースエンジニアによって使われるだろうということを |
1774 | 1789 | 心に留めておいてください。 |
1775 | 1790 | |
1776 | 1791 | =head2 Committing to maintenance versions |
1777 | 1792 | |
1778 | 1793 | (メンテナンスバージョンにコミットする) |
1779 | 1794 | |
1780 | 1795 | =begin original |
1781 | 1796 | |
1782 | 1797 | Maintenance versions should only be altered to add critical bug fixes, |
1783 | 1798 | see L<perlpolicy>. |
1784 | 1799 | |
1785 | 1800 | =end original |
1786 | 1801 | |
1787 | 1802 | メンテナンスバージョンは、重要なバグ修正を追加する場合にのみ変更してください; |
1788 | 1803 | L<perlpolicy> を参照してください。 |
1789 | 1804 | |
1790 | 1805 | =begin original |
1791 | 1806 | |
1792 | 1807 | To commit to a maintenance version of perl, you need to create a local |
1793 | 1808 | tracking branch: |
1794 | 1809 | |
1795 | 1810 | =end original |
1796 | 1811 | |
1797 | 1812 | perl のメンテナンスバージョンにコミットするには、 |
1798 | 1813 | ローカル追跡ブランチを作成する必要があります。 |
1799 | 1814 | |
1800 | 1815 | % git checkout --track -b maint-5.005 origin/maint-5.005 |
1801 | 1816 | |
1802 | 1817 | =begin original |
1803 | 1818 | |
1804 | 1819 | This creates a local branch named C<maint-5.005>, which tracks the |
1805 | 1820 | remote branch C<origin/maint-5.005>. Then you can pull, commit, merge |
1806 | 1821 | and push as before. |
1807 | 1822 | |
1808 | 1823 | =end original |
1809 | 1824 | |
1810 | 1825 | これにより、リモートブランチ C<origin/maint-5.005> を追跡する |
1811 | 1826 | C<maint-5.005> という名前のローカルブランチが作成されます。 |
1812 | 1827 | 次に、以前と同じようにプル、コミット、マージ、プッシュを行うことができます。 |
1813 | 1828 | |
1814 | 1829 | =begin original |
1815 | 1830 | |
1816 | 1831 | You can also cherry-pick commits from blead and another branch, by |
1817 | 1832 | using the C<git cherry-pick> command. It is recommended to use the |
1818 | 1833 | B<-x> option to C<git cherry-pick> in order to record the SHA1 of the |
1819 | 1834 | original commit in the new commit message. |
1820 | 1835 | |
1821 | 1836 | =end original |
1822 | 1837 | |
1823 | 1838 | C<git cherry-pick> コマンドを使用して、blead と別のブランチから |
1824 | 1839 | コミットをチェリーピックすることもできます。 |
1825 | 1840 | 元のコミットの SHA1 を新しいコミットメッセージに記録するために、 |
1826 | 1841 | C<git cherry-pick> に B<-x> オプションを使うことを勧めます。 |
1827 | 1842 | |
1828 | 1843 | =begin original |
1829 | 1844 | |
1830 | 1845 | Before pushing any change to a maint version, make sure you've |
1831 | 1846 | satisfied the steps in L</Committing to blead> above. |
1832 | 1847 | |
1833 | 1848 | =end original |
1834 | 1849 | |
1835 | 1850 | maint 版に何かをプッシュする前に、前述の |
1836 | 1851 | L</Committing to blead> のステップを満たしていることを確認してください。 |
1837 | 1852 | |
1838 | 1853 | =head2 Merging from a branch via GitHub |
1839 | 1854 | |
1840 | 1855 | (GitHub 経由のブランチをマージする) |
1841 | 1856 | |
1842 | 1857 | =begin original |
1843 | 1858 | |
1844 | 1859 | While we don't encourage the submission of patches via GitHub, that |
1845 | 1860 | will still happen. Here is a guide to merging patches from a GitHub |
1846 | 1861 | repository. |
1847 | 1862 | |
1848 | 1863 | =end original |
1849 | 1864 | |
1850 | 1865 | 私たちはパッチを GitHub 経由で投稿することを勧めていませんが、 |
1851 | 1866 | 実際発生します。 |
1852 | 1867 | これは GitHub リポジトリからのパッチをマージするためのガイドです。 |
1853 | 1868 | |
1854 | 1869 | % git remote add avar git://github.com/avar/perl.git |
1855 | 1870 | % git fetch avar |
1856 | 1871 | |
1857 | 1872 | =begin original |
1858 | 1873 | |
1859 | 1874 | Now you can see the differences between the branch and blead: |
1860 | 1875 | |
1861 | 1876 | =end original |
1862 | 1877 | |
1863 | 1878 | これで、そのブランチと blead の差分を見られるようになりました: |
1864 | 1879 | |
1865 | 1880 | % git diff avar/orange |
1866 | 1881 | |
1867 | 1882 | =begin original |
1868 | 1883 | |
1869 | 1884 | And you can see the commits: |
1870 | 1885 | |
1871 | 1886 | =end original |
1872 | 1887 | |
1873 | 1888 | そしてコミットを表示できます: |
1874 | 1889 | |
1875 | 1890 | % git log avar/orange |
1876 | 1891 | |
1877 | 1892 | =begin original |
1878 | 1893 | |
1879 | 1894 | If you approve of a specific commit, you can cherry pick it: |
1880 | 1895 | |
1881 | 1896 | =end original |
1882 | 1897 | |
1883 | 1898 | 特定のコミットを承認する場合は、次のようにして選択できます: |
1884 | 1899 | |
1885 | 1900 | % git cherry-pick 0c24b290ae02b2ab3304f51d5e11e85eb3659eae |
1886 | 1901 | |
1887 | 1902 | =begin original |
1888 | 1903 | |
1889 | 1904 | Or you could just merge the whole branch if you like it all: |
1890 | 1905 | |
1891 | 1906 | =end original |
1892 | 1907 | |
1893 | 1908 | または、必要に応じてブランチ全体をマージすることもできます: |
1894 | 1909 | |
1895 | 1910 | % git merge avar/orange |
1896 | 1911 | |
1897 | 1912 | =begin original |
1898 | 1913 | |
1899 | 1914 | And then push back to the repository: |
1900 | 1915 | |
1901 | 1916 | =end original |
1902 | 1917 | |
1903 | 1918 | そして、リポジトリにプッシュバックします: |
1904 | 1919 | |
1905 | % git push | |
1920 | % git push origin blead | |
1906 | 1921 | |
1922 | ||
1923 | =head2 Using a smoke-me branch to test changes | |
1924 | ||
1925 | (変更をテストするために smoke-me ブランチを使う) | |
1926 | ||
1927 | =begin original | |
1928 | ||
1929 | Sometimes a change affects code paths which you cannot test on the OSes | |
1930 | which are directly available to you and it would be wise to have users | |
1931 | on other OSes test the change before you commit it to blead. | |
1932 | ||
1933 | =end original | |
1934 | ||
1935 | 時々、ある変更があなたが直接利用できない OS に関するテストできない | |
1936 | コードパスに影響することがあるので、 | |
1937 | blead にコミットする前に他の OS のユーザーが変更をテストしてもらうのが | |
1938 | 賢明です。 | |
1939 | ||
1940 | =begin original | |
1941 | ||
1942 | Fortunately, there is a way to get your change smoke-tested on various | |
1943 | OSes: push it to a "smoke-me" branch and wait for certain automated | |
1944 | smoke-testers to report the results from their OSes. | |
1945 | ||
1946 | =end original | |
1947 | ||
1948 | 幸い、様々な OS であなたの変更をスモークテストする方法があります: | |
1949 | これを "smoke-me" ブランチとしてプッシュして、いくつかの自動 | |
1950 | smoke-testers が彼らの OS からの結果を報告するのを待ちます。 | |
1951 | ||
1952 | =begin original | |
1953 | ||
1954 | The procedure for doing this is roughly as follows (using the example of | |
1955 | of tonyc's smoke-me branch called win32stat): | |
1956 | ||
1957 | =end original | |
1958 | ||
1959 | これをするための手順は大まかに次のようなものです | |
1960 | (tonyc による win32stat と呼ばれる smoke-me ブランチの例を使います): | |
1961 | ||
1962 | =begin original | |
1963 | ||
1964 | First, make a local branch and switch to it: | |
1965 | ||
1966 | =end original | |
1967 | ||
1968 | まず、ローカルブランチを作ってそれに切り替えます: | |
1969 | ||
1970 | % git checkout -b win32stat | |
1971 | ||
1972 | =begin original | |
1973 | ||
1974 | Make some changes, build perl and test your changes, then commit them to | |
1975 | your local branch. Then push your local branch to a remote smoke-me | |
1976 | branch: | |
1977 | ||
1978 | =end original | |
1979 | ||
1980 | 変更を行い、perl をビルドして変更をテストし、ローカルブランチに | |
1981 | コミットします。 | |
1982 | それからローカルブランチをリモートの smoke-me ブランチにプッシュします: | |
1983 | ||
1984 | % git push origin win32stat:smoke-me/tonyc/win32stat | |
1985 | ||
1986 | =begin original | |
1987 | ||
1988 | Now you can switch back to blead locally: | |
1989 | ||
1990 | =end original | |
1991 | ||
1992 | ここでローカルの blead に戻します: | |
1993 | ||
1994 | % git checkout blead | |
1995 | ||
1996 | =begin original | |
1997 | ||
1998 | and continue working on other things while you wait a day or two, | |
1999 | keeping an eye on the results reported for your smoke-me branch at | |
2000 | L<http://perl.develop-help.com/?b=smoke-me/tonyc/win32state>. | |
2001 | ||
2002 | =end original | |
2003 | ||
2004 | そして他の作業をして数日待ち、smoke-me ブランチに対する報告される結果 | |
2005 | L<http://perl.develop-help.com/?b=smoke-me/tonyc/win32state> を注視します。 | |
2006 | ||
2007 | =begin original | |
2008 | ||
2009 | If all is well then update your blead branch: | |
2010 | ||
2011 | =end original | |
2012 | ||
2013 | 全てがうまくいっていれば、手元の blead ブランチを更新します: | |
2014 | ||
2015 | % git pull | |
2016 | ||
2017 | =begin original | |
2018 | ||
2019 | then checkout your smoke-me branch once more and rebase it on blead: | |
2020 | ||
2021 | =end original | |
2022 | ||
2023 | それからもう一度手元の smoke-me ブランチをチェックアウトして、 | |
2024 | それを blead にリベースします: | |
2025 | ||
2026 | % git rebase blead win32stat | |
2027 | ||
2028 | =begin original | |
2029 | ||
2030 | Now switch back to blead and merge your smoke-me branch into it: | |
2031 | ||
2032 | =end original | |
2033 | ||
2034 | ここで blead に戻して、smoke-me ブランチをマージします: | |
2035 | ||
2036 | % git checkout blead | |
2037 | % git merge win32stat | |
2038 | ||
2039 | =begin original | |
2040 | ||
2041 | As described earlier, if there are many changes on your smoke-me branch | |
2042 | then you should prepare a merge commit in which to give an overview of | |
2043 | those changes by using the following command instead of the last | |
2044 | command above: | |
2045 | ||
2046 | =end original | |
2047 | ||
2048 | 前述したように、smoke-me ブランチに多くの変更がある場合は、 | |
2049 | 前述の最後のコマンドの代わりに次のコマンドを使うことで、 | |
2050 | これらの変更の概要を記録するためのマージコミットを準備するべきです: | |
2051 | ||
2052 | % git merge win32stat --no-ff --no-commit | |
2053 | ||
2054 | =begin original | |
2055 | ||
2056 | You should now build perl and test your (merged) changes one last time | |
2057 | (ideally run the whole test suite, but failing that at least run the | |
2058 | F<t/porting/*.t> tests) before pushing your changes as usual: | |
2059 | ||
2060 | =end original | |
2061 | ||
2062 | ここで perl をビルドして、いつものように変更をプッシュする前に、 | |
2063 | あなたの(マージされた)変更を最後にもう一度テストするべきです | |
2064 | (理想的には、テストスイート全体を実行します; しかし、 | |
2065 | 少なくとも F<t/porting/*.t> テストを実行します) 。 | |
2066 | ||
2067 | % git push origin blead | |
2068 | ||
2069 | =begin original | |
2070 | ||
2071 | Finally, you should then delete the remote smoke-me branch: | |
2072 | ||
2073 | =end original | |
2074 | ||
2075 | 最後に、リモートの smoke-me ブランチを削除して: | |
2076 | ||
2077 | % git push origin :smoke-me/tonyc/win32stat | |
2078 | ||
2079 | =begin original | |
2080 | ||
2081 | (which is likely to produce a warning like this, which can be ignored: | |
2082 | ||
2083 | =end original | |
2084 | ||
2085 | (これはおそらく次のような警告を出しますが、無視できます: | |
2086 | ||
2087 | remote: fatal: ambiguous argument | |
2088 | 'refs/heads/smoke-me/tonyc/win32stat': | |
2089 | unknown revision or path not in the working tree. | |
2090 | remote: Use '--' to separate paths from revisions | |
2091 | ||
2092 | =begin original | |
2093 | ||
2094 | ) and then delete your local branch: | |
2095 | ||
2096 | =end original | |
2097 | ||
2098 | ) そしてローカルブランチを削除します: | |
2099 | ||
2100 | % git branch -d win32stat | |
2101 | ||
1907 | 2102 | =head2 A note on camel and dromedary |
1908 | 2103 | |
1909 | 2104 | (camel と dromedary に関する注意) |
1910 | 2105 | |
1911 | 2106 | =begin original |
1912 | 2107 | |
1913 | 2108 | The committers have SSH access to the two servers that serve |
1914 | 2109 | C<perl5.git.perl.org>. One is C<perl5.git.perl.org> itself (I<camel>), |
1915 | 2110 | which is the 'master' repository. The second one is |
1916 | 2111 | C<users.perl5.git.perl.org> (I<dromedary>), which can be used for |
1917 | 2112 | general testing and development. Dromedary syncs the git tree from |
1918 | 2113 | camel every few minutes, you should not push there. Both machines also |
1919 | have a full CPAN mirror in /srv/CPAN, please use this. To share files | |
2114 | have a full CPAN mirror in F</srv/CPAN>, please use this. To share files | |
1920 | with the general public, dromedary serves your ~/public_html/ as | |
2115 | with the general public, dromedary serves your F<~/public_html/> as | |
1921 | 2116 | C<http://users.perl5.git.perl.org/~yourlogin/> |
1922 | 2117 | |
1923 | 2118 | =end original |
1924 | 2119 | |
1925 | 2120 | コミッタは、C<perl5.git.perl.org> にサービスを提供する二つの |
1926 | 2121 | サーバにアクセスできます。 |
1927 | 2122 | C<perl5.git.perl.org> 自身 (I<camel>) で、 |
1928 | 2123 | これが「マスター」リポジトリです。 |
1929 | 2124 | 二つ目は C<users.perl5.git.perl.org> (I<dromedary>) で、 |
1930 | 2125 | 一般的なテストと開発に使用できます。 |
1931 | 2126 | dromedary は数分ごとに camel から git ツリーを同期するので、そこに |
1932 | 2127 | プッシュしてはいけません。 |
1933 | 両方のマシンには /srv/CPAN に完全な CPAN ミラーもあるので、 | |
2128 | 両方のマシンには F</srv/CPAN> に完全な CPAN ミラーもあるので、 | |
1934 | 2129 | これを使ってください。 |
1935 | 2130 | dromedary はファイルを一般公開するために、 |
1936 | ~/public_html/ を C<http://users.perl5.git.perl.org/~yourlogin/> として | |
2131 | F<~/public_html/> を C<http://users.perl5.git.perl.org/~yourlogin/> として | |
1937 | 2132 | 提供しています。 |
1938 | 2133 | |
1939 | 2134 | =begin original |
1940 | 2135 | |
1941 | 2136 | These hosts have fairly strict firewalls to the outside. Outgoing, only |
1942 | 2137 | rsync, ssh and git are allowed. For http and ftp, you can use |
1943 | 2138 | http://webproxy:3128 as proxy. Incoming, the firewall tries to detect |
1944 | 2139 | attacks and blocks IP addresses with suspicious activity. This |
1945 | 2140 | sometimes (but very rarely) has false positives and you might get |
1946 | 2141 | blocked. The quickest way to get unblocked is to notify the admins. |
1947 | 2142 | |
1948 | 2143 | =end original |
1949 | 2144 | |
1950 | 2145 | これらのホストは、外部に対してかなり厳格なファイアウォールを持っています。 |
1951 | 2146 | 送信は rsync、ssh、git だけが許可されています。 |
1952 | 2147 | http と ftp に対しては、プロキシとして http://webproxy:3128 を使用できます。 |
1953 | 2148 | 受信は、ファイアウォールは攻撃を検出し、疑わしいアクティビティを持つ |
1954 | 2149 | IP アドレスをブロックしようとします。 |
1955 | 2150 | これは時に(非常にまれに)誤検出があり、ブロックされる可能性があります。 |
1956 | 2151 | ブロックを解除する最も簡単な方法は、管理者に通知することです。 |
1957 | 2152 | |
1958 | 2153 | =begin original |
1959 | 2154 | |
1960 | 2155 | These two boxes are owned, hosted, and operated by booking.com. You can |
1961 | 2156 | reach the sysadmins in #p5p on irc.perl.org or via mail to |
1962 | ||
2157 | L<perl5-porters@perl.org|mailto:perl5-porters@perl.org>. | |
1963 | 2158 | |
1964 | 2159 | =end original |
1965 | 2160 | |
1966 | 2161 | これら二つのボックスは、booking.com によって所有され、ホストされ、 |
1967 | 2162 | 運営されています。 |
1968 | 2163 | システム管理者には、irc.perl.org の #p5p か、 |
1969 | ||
2164 | L<perl5-porters@perl.org|mailto:perl5-porters@perl.org> へのメールで | |
2165 | 連絡できます。 | |
1970 | 2166 | |
1971 | 2167 | =begin meta |
1972 | 2168 | |
1973 | 2169 | Translate: SHIRAKATA Kentaro <argrath@ub32.org> |
1974 | 2170 | Status: completed |
1975 | 2171 | |
1976 | 2172 | =end meta |