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