1PERLGIT(1)             Perl Programmers Reference Guide             PERLGIT(1)
2
3
4

NAME

6       perlgit - Detailed information about git and the Perl repository
7

DESCRIPTION

9       This document provides details on using git to develop Perl. If you are
10       just interested in working on a quick patch, see perlhack first.  This
11       document is intended for people who are regular contributors to Perl,
12       including those with write access to the git repository.
13

CLONING THE REPOSITORY

15       All of Perl's source code is kept centrally in a Git repository at
16       perl5.git.perl.org.
17
18       You can make a read-only clone of the repository by running:
19
20         % git clone git://perl5.git.perl.org/perl.git perl
21
22       This uses the git protocol (port 9418).
23
24       If you cannot use the git protocol for firewall reasons, you can also
25       clone via http, though this is much slower:
26
27         % git clone http://perl5.git.perl.org/perl.git perl
28

WORKING WITH THE REPOSITORY

30       Once you have changed into the repository directory, you can inspect
31       it. After a clone the repository will contain a single local branch,
32       which will be the current branch as well, as indicated by the asterisk.
33
34         % git branch
35         * blead
36
37       Using the -a switch to "branch" will also show the remote tracking
38       branches in the repository:
39
40         % git branch -a
41         * blead
42           origin/HEAD
43           origin/blead
44         ...
45
46       The branches that begin with "origin" correspond to the "git remote"
47       that you cloned from (which is named "origin"). Each branch on the
48       remote will be exactly tracked by these branches. You should NEVER do
49       work on these remote tracking branches. You only ever do work in a
50       local branch. Local branches can be configured to automerge (on pull)
51       from a designated remote tracking branch. This is the case with the
52       default branch "blead" which will be configured to merge from the
53       remote tracking branch "origin/blead".
54
55       You can see recent commits:
56
57         % git log
58
59       And pull new changes from the repository, and update your local
60       repository (must be clean first)
61
62         % git pull
63
64       Assuming we are on the branch "blead" immediately after a pull, this
65       command would be more or less equivalent to:
66
67         % git fetch
68         % git merge origin/blead
69
70       In fact if you want to update your local repository without touching
71       your working directory you do:
72
73         % git fetch
74
75       And if you want to update your remote-tracking branches for all defined
76       remotes simultaneously you can do
77
78         % git remote update
79
80       Neither of these last two commands will update your working directory,
81       however both will update the remote-tracking branches in your
82       repository.
83
84       To make a local branch of a remote branch:
85
86         % git checkout -b maint-5.10 origin/maint-5.10
87
88       To switch back to blead:
89
90         % git checkout blead
91
92   Finding out your status
93       The most common git command you will use will probably be
94
95         % git status
96
97       This command will produce as output a description of the current state
98       of the repository, including modified files and unignored untracked
99       files, and in addition it will show things like what files have been
100       staged for the next commit, and usually some useful information about
101       how to change things. For instance the following:
102
103         $ git status
104         # On branch blead
105         # Your branch is ahead of 'origin/blead' by 1 commit.
106         #
107         # Changes to be committed:
108         #   (use "git reset HEAD <file>..." to unstage)
109         #
110         #       modified:   pod/perlgit.pod
111         #
112         # Changed but not updated:
113         #   (use "git add <file>..." to update what will be committed)
114         #
115         #       modified:   pod/perlgit.pod
116         #
117         # Untracked files:
118         #   (use "git add <file>..." to include in what will be committed)
119         #
120         #       deliberate.untracked
121
122       This shows that there were changes to this document staged for commit,
123       and that there were further changes in the working directory not yet
124       staged. It also shows that there was an untracked file in the working
125       directory, and as you can see shows how to change all of this. It also
126       shows that there is one commit on the working branch "blead" which has
127       not been pushed to the "origin" remote yet. NOTE: that this output is
128       also what you see as a template if you do not provide a message to "git
129       commit".
130
131   Patch workflow
132       First, please read perlhack for details on hacking the Perl core.  That
133       document covers many details on how to create a good patch.
134
135       If you already have a Perl repository, you should ensure that you're on
136       the blead branch, and your repository is up to date:
137
138         % git checkout blead
139         % git pull
140
141       It's preferable to patch against the latest blead version, since this
142       is where new development occurs for all changes other than critical bug
143       fixes. Critical bug fix patches should be made against the relevant
144       maint branches, or should be submitted with a note indicating all the
145       branches where the fix should be applied.
146
147       Now that we have everything up to date, we need to create a temporary
148       new branch for these changes and switch into it:
149
150         % git checkout -b orange
151
152       which is the short form of
153
154         % git branch orange
155         % git checkout orange
156
157       Creating a topic branch makes it easier for the maintainers to rebase
158       or merge back into the master blead for a more linear history. If you
159       don't work on a topic branch the maintainer has to manually cherry pick
160       your changes onto blead before they can be applied.
161
162       That'll get you scolded on perl5-porters, so don't do that. Be Awesome.
163
164       Then make your changes. For example, if Leon Brocard changes his name
165       to Orange Brocard, we should change his name in the AUTHORS file:
166
167         % perl -pi -e 's{Leon Brocard}{Orange Brocard}' AUTHORS
168
169       You can see what files are changed:
170
171         % git status
172         # On branch orange
173         # Changes to be committed:
174         #   (use "git reset HEAD <file>..." to unstage)
175         #
176         #    modified:   AUTHORS
177         #
178
179       And you can see the changes:
180
181         % git diff
182         diff --git a/AUTHORS b/AUTHORS
183         index 293dd70..722c93e 100644
184         --- a/AUTHORS
185         +++ b/AUTHORS
186         @@ -541,7 +541,7 @@    Lars Hecking                   <lhecking@nmrc.ucc.ie>
187          Laszlo Molnar                  <laszlo.molnar@eth.ericsson.se>
188          Leif Huhn                      <leif@hale.dkstat.com>
189          Len Johnson                    <lenjay@ibm.net>
190         -Leon Brocard                   <acme@astray.com>
191         +Orange Brocard                 <acme@astray.com>
192          Les Peters                     <lpeters@aol.net>
193          Lesley Binks                   <lesley.binks@gmail.com>
194          Lincoln D. Stein               <lstein@cshl.org>
195
196       Now commit your change locally:
197
198         % git commit -a -m 'Rename Leon Brocard to Orange Brocard'
199         Created commit 6196c1d: Rename Leon Brocard to Orange Brocard
200          1 files changed, 1 insertions(+), 1 deletions(-)
201
202       The "-a" option is used to include all files that git tracks that you
203       have changed. If at this time, you only want to commit some of the
204       files you have worked on, you can omit the "-a" and use the command
205       "git add FILE ..." before doing the commit. "git add --interactive"
206       allows you to even just commit portions of files instead of all the
207       changes in them.
208
209       The "-m" option is used to specify the commit message. If you omit it,
210       git will open a text editor for you to compose the message
211       interactively. This is useful when the changes are more complex than
212       the sample given here, and, depending on the editor, to know that the
213       first line of the commit message doesn't exceed the 50 character legal
214       maximum.
215
216       Once you've finished writing your commit message and exited your
217       editor, git will write your change to disk and tell you something like
218       this:
219
220         Created commit daf8e63: explain git status and stuff about remotes
221          1 files changed, 83 insertions(+), 3 deletions(-)
222
223       If you re-run "git status", you should see something like this:
224
225         % git status
226         # On branch blead
227         # Your branch is ahead of 'origin/blead' by 2 commits.
228         #
229         # Untracked files:
230         #   (use "git add <file>..." to include in what will be committed)
231         #
232         #       deliberate.untracked
233         nothing added to commit but untracked files present (use "git add" to track)
234
235       When in doubt, before you do anything else, check your status and read
236       it carefully, many questions are answered directly by the git status
237       output.
238
239       You can examine your last commit with:
240
241         % git show HEAD
242
243       and if you are not happy with either the description or the patch
244       itself you can fix it up by editing the files once more and then issue:
245
246         % git commit -a --amend
247
248       Now you should create a patch file for all your local changes:
249
250         % git format-patch -M origin..
251         0001-Rename-Leon-Brocard-to-Orange-Brocard.patch
252
253       You should now send an email to perlbug@perl.org
254       <mailto:perlbug@perl.org> with a description of your changes, and
255       include this patch file as an attachment. In addition to being tracked
256       by RT, mail to perlbug will automatically be forwarded to perl5-porters
257       (with manual moderation, so please be patient). You should only send
258       patches to perl5-porters@perl.org <mailto:perl5-porters@perl.org>
259       directly if the patch is not ready to be applied, but intended for
260       discussion.
261
262       See the next section for how to configure and use git to send these
263       emails for you.
264
265       If you want to delete your temporary branch, you may do so with:
266
267         % git checkout blead
268         % git branch -d orange
269         error: The branch 'orange' is not an ancestor of your current HEAD.
270         If you are sure you want to delete it, run 'git branch -D orange'.
271         % git branch -D orange
272         Deleted branch orange.
273
274   Committing your changes
275       Assuming that you'd like to commit all the changes you've made as a
276       single atomic unit, run this command:
277
278          % git commit -a
279
280       (That "-a" tells git to add every file you've changed to this commit.
281       New files aren't automatically added to your commit when you use
282       "commit -a" If you want to add files or to commit some, but not all of
283       your changes, have a look at the documentation for "git add".)
284
285       Git will start up your favorite text editor, so that you can craft a
286       commit message for your change. See "Commit message" in perlhack for
287       more information about what makes a good commit message.
288
289       Once you've finished writing your commit message and exited your
290       editor, git will write your change to disk and tell you something like
291       this:
292
293         Created commit daf8e63: explain git status and stuff about remotes
294          1 files changed, 83 insertions(+), 3 deletions(-)
295
296       If you re-run "git status", you should see something like this:
297
298         % git status
299         # On branch blead
300         # Your branch is ahead of 'origin/blead' by 2 commits.
301         #
302         # Untracked files:
303         #   (use "git add <file>..." to include in what will be committed)
304         #
305         #       deliberate.untracked
306         nothing added to commit but untracked files present (use "git add" to track)
307
308       When in doubt, before you do anything else, check your status and read
309       it carefully, many questions are answered directly by the git status
310       output.
311
312   Using git to send patch emails
313       Please read perlhack first in order to figure out where your patches
314       should be sent.
315
316       In your ~/git/perl repository, set the destination email to perl's bug
317       tracker:
318
319         $ git config sendemail.to perlbug@perl.org
320
321       Or maybe perl5-porters:
322
323         $ git config sendemail.to perl5-porters@perl.org
324
325       Then you can use git directly to send your patch emails:
326
327         $ git send-email 0001-Rename-Leon-Brocard-to-Orange-Brocard.patch
328
329       You may need to set some configuration variables for your particular
330       email service provider. For example, to set your global git config to
331       send email via a gmail account:
332
333         $ git config --global sendemail.smtpserver smtp.gmail.com
334         $ git config --global sendemail.smtpssl 1
335         $ git config --global sendemail.smtpuser YOURUSERNAME@gmail.com
336
337       With this configuration, you will be prompted for your gmail password
338       when you run 'git send-email'. You can also configure
339       "sendemail.smtppass" with your password if you don't care about having
340       your password in the .gitconfig file.
341
342   A note on derived files
343       Be aware that many files in the distribution are derivative--avoid
344       patching them, because git won't see the changes to them, and the build
345       process will overwrite them. Patch the originals instead. Most
346       utilities (like perldoc) are in this category, i.e. patch
347       utils/perldoc.PL rather than utils/perldoc. Similarly, don't create
348       patches for files under $src_root/ext from their copies found in
349       $install_root/lib. If you are unsure about the proper location of a
350       file that may have gotten copied while building the source
351       distribution, consult the "MANIFEST".
352
353   Cleaning a working directory
354       The command "git clean" can with varying arguments be used as a
355       replacement for "make clean".
356
357       To reset your working directory to a pristine condition you can do:
358
359         % git clean -dxf
360
361       However, be aware this will delete ALL untracked content. You can use
362
363         % git clean -Xf
364
365       to remove all ignored untracked files, such as build and test
366       byproduct, but leave any  manually created files alone.
367
368       If you only want to cancel some uncommitted edits, you can use "git
369       checkout" and give it a list of files to be reverted, or "git checkout
370       -f" to revert them all.
371
372       If you want to cancel one or several commits, you can use "git reset".
373
374   Bisecting
375       "git" provides a built-in way to determine which commit should be
376       blamed for introducing a given bug. "git bisect" performs a binary
377       search of history to locate the first failing commit. It is fast,
378       powerful and flexible, but requires some setup and to automate the
379       process an auxiliary shell script is needed.
380
381       The core provides a wrapper program, Porting/bisect.pl, which attempts
382       to simplify as much as possible, making bisecting as simple as running
383       a Perl one-liner. For example, if you want to know when this became an
384       error:
385
386           perl -e 'my $a := 2'
387
388       you simply run this:
389
390           .../Porting/bisect.pl -e 'my $a := 2;'
391
392       Using "bisect.pl", with one command (and no other files) it's easy to
393       find out
394
395       ·   Which commit caused this example code to break?
396
397       ·   Which commit caused this example code to start working?
398
399       ·   Which commit added the first file to match this regex?
400
401       ·   Which commit removed the last file to match this regex?
402
403       usually without needing to know which versions of perl to use as start
404       and end revisions, as bisect.pl automatically searches to find the
405       earliest stable version for which the test case passes. Run
406       "Porting/bisect.pl --help" for the full documentation, including how to
407       set the "Configure" and build time options.
408
409       If you require more flexibility than Porting/bisect.pl has to offer,
410       you'll need to run "git bisect" yourself. It's most useful to use "git
411       bisect run" to automate the building and testing of perl revisions. For
412       this you'll need a shell script for "git" to call to test a particular
413       revision. An example script is Porting/bisect-example.sh, which you
414       should copy outside of the repository, as the bisect process will reset
415       the state to a clean checkout as it runs. The instructions below assume
416       that you copied it as ~/run and then edited it as appropriate.
417
418       You first enter in bisect mode with:
419
420         % git bisect start
421
422       For example, if the bug is present on "HEAD" but wasn't in 5.10.0,
423       "git" will learn about this when you enter:
424
425         % git bisect bad
426         % git bisect good perl-5.10.0
427         Bisecting: 853 revisions left to test after this
428
429       This results in checking out the median commit between "HEAD" and
430       "perl-5.10.0". You can then run the bisecting process with:
431
432         % git bisect run ~/run
433
434       When the first bad commit is isolated, "git bisect" will tell you so:
435
436         ca4cfd28534303b82a216cfe83a1c80cbc3b9dc5 is first bad commit
437         commit ca4cfd28534303b82a216cfe83a1c80cbc3b9dc5
438         Author: Dave Mitchell <davem@fdisolutions.com>
439         Date:   Sat Feb 9 14:56:23 2008 +0000
440
441             [perl #49472] Attributes + Unknown Error
442             ...
443
444         bisect run success
445
446       You can peek into the bisecting process with "git bisect log" and "git
447       bisect visualize". "git bisect reset" will get you out of bisect mode.
448
449       Please note that the first "good" state must be an ancestor of the
450       first "bad" state. If you want to search for the commit that solved
451       some bug, you have to negate your test case (i.e. exit with 1 if OK and
452       0 if not) and still mark the lower bound as "good" and the upper as
453       "bad". The "first bad commit" has then to be understood as the "first
454       commit where the bug is solved".
455
456       "git help bisect" has much more information on how you can tweak your
457       binary searches.
458

Topic branches and rewriting history

460       Individual committers should create topic branches under
461       yourname/some_descriptive_name. Other committers should check with a
462       topic branch's creator before making any change to it.
463
464       The simplest way to create a remote topic branch that works on all
465       versions of git is to push the current head as a new branch on the
466       remote, then check it out locally:
467
468         $ branch="$yourname/$some_descriptive_name"
469         $ git push origin HEAD:$branch
470         $ git checkout -b $branch origin/$branch
471
472       Users of git 1.7 or newer can do it in a more obvious manner:
473
474         $ branch="$yourname/$some_descriptive_name"
475         $ git checkout -b $branch
476         $ git push origin -u $branch
477
478       If you are not the creator of yourname/some_descriptive_name, you might
479       sometimes find that the original author has edited the branch's
480       history. There are lots of good reasons for this. Sometimes, an author
481       might simply be rebasing the branch onto a newer source point.
482       Sometimes, an author might have found an error in an early commit which
483       they wanted to fix before merging the branch to blead.
484
485       Currently the master repository is configured to forbid non-fast-
486       forward merges. This means that the branches within can not be rebased
487       and pushed as a single step.
488
489       The only way you will ever be allowed to rebase or modify the history
490       of a pushed branch is to delete it and push it as a new branch under
491       the same name. Please think carefully about doing this. It may be
492       better to sequentially rename your branches so that it is easier for
493       others working with you to cherry-pick their local changes onto the new
494       version. (XXX: needs explanation).
495
496       If you want to rebase a personal topic branch, you will have to delete
497       your existing topic branch and push as a new version of it. You can do
498       this via the following formula (see the explanation about "refspec"'s
499       in the git push documentation for details) after you have rebased your
500       branch:
501
502          # first rebase
503          $ git checkout $user/$topic
504          $ git fetch
505          $ git rebase origin/blead
506
507          # then "delete-and-push"
508          $ git push origin :$user/$topic
509          $ git push origin $user/$topic
510
511       NOTE: it is forbidden at the repository level to delete any of the
512       "primary" branches. That is any branch matching
513       "m!^(blead|maint|perl)!". Any attempt to do so will result in git
514       producing an error like this:
515
516           $ git push origin :blead
517           *** It is forbidden to delete blead/maint branches in this repository
518           error: hooks/update exited with error code 1
519           error: hook declined to update refs/heads/blead
520           To ssh://perl5.git.perl.org/perl
521            ! [remote rejected] blead (hook declined)
522            error: failed to push some refs to 'ssh://perl5.git.perl.org/perl'
523
524       As a matter of policy we do not edit the history of the blead and
525       maint-* branches. If a typo (or worse) sneaks into a commit to blead or
526       maint-*, we'll fix it in another commit. The only types of updates
527       allowed on these branches are "fast-forward's", where all history is
528       preserved.
529
530       Annotated tags in the canonical perl.git repository will never be
531       deleted or modified. Think long and hard about whether you want to push
532       a local tag to perl.git before doing so. (Pushing unannotated tags is
533       not allowed.)
534
535   Grafts
536       The perl history contains one mistake which was not caught in the
537       conversion: a merge was recorded in the history between blead and
538       maint-5.10 where no merge actually occurred. Due to the nature of git,
539       this is now impossible to fix in the public repository. You can remove
540       this mis-merge locally by adding the following line to your
541       ".git/info/grafts" file:
542
543         296f12bbbbaa06de9be9d09d3dcf8f4528898a49 434946e0cb7a32589ed92d18008aaa1d88515930
544
545       It is particularly important to have this graft line if any bisecting
546       is done in the area of the "merge" in question.
547

WRITE ACCESS TO THE GIT REPOSITORY

549       Once you have write access, you will need to modify the URL for the
550       origin remote to enable pushing. Edit .git/config with the
551       git-config(1) command:
552
553         % git config remote.origin.url ssh://perl5.git.perl.org/perl.git
554
555       You can also set up your user name and e-mail address. Most people do
556       this once globally in their ~/.gitconfig by doing something like:
557
558         % git config --global user.name "var Arnfjoerd` Bjarmason"
559         % git config --global user.email avarab@gmail.com
560
561       However if you'd like to override that just for perl then execute then
562       execute something like the following in perl:
563
564         % git config user.email avar@cpan.org
565
566       It is also possible to keep "origin" as a git remote, and add a new
567       remote for ssh access:
568
569         % git remote add camel perl5.git.perl.org:/perl.git
570
571       This allows you to update your local repository by pulling from
572       "origin", which is faster and doesn't require you to authenticate, and
573       to push your changes back with the "camel" remote:
574
575         % git fetch camel
576         % git push camel
577
578       The "fetch" command just updates the "camel" refs, as the objects
579       themselves should have been fetched when pulling from "origin".
580

Accepting a patch

582       If you have received a patch file generated using the above section,
583       you should try out the patch.
584
585       First we need to create a temporary new branch for these changes and
586       switch into it:
587
588         % git checkout -b experimental
589
590       Patches that were formatted by "git format-patch" are applied with "git
591       am":
592
593         % git am 0001-Rename-Leon-Brocard-to-Orange-Brocard.patch
594         Applying Rename Leon Brocard to Orange Brocard
595
596       If just a raw diff is provided, it is also possible use this two-step
597       process:
598
599         % git apply bugfix.diff
600         % git commit -a -m "Some fixing" --author="That Guy <that.guy@internets.com>"
601
602       Now we can inspect the change:
603
604         % git show HEAD
605         commit b1b3dab48344cff6de4087efca3dbd63548ab5e2
606         Author: Leon Brocard <acme@astray.com>
607         Date:   Fri Dec 19 17:02:59 2008 +0000
608
609           Rename Leon Brocard to Orange Brocard
610
611         diff --git a/AUTHORS b/AUTHORS
612         index 293dd70..722c93e 100644
613         --- a/AUTHORS
614         +++ b/AUTHORS
615         @@ -541,7 +541,7 @@ Lars Hecking                        <lhecking@nmrc.ucc.ie>
616          Laszlo Molnar                  <laszlo.molnar@eth.ericsson.se>
617          Leif Huhn                      <leif@hale.dkstat.com>
618          Len Johnson                    <lenjay@ibm.net>
619         -Leon Brocard                   <acme@astray.com>
620         +Orange Brocard                 <acme@astray.com>
621          Les Peters                     <lpeters@aol.net>
622          Lesley Binks                   <lesley.binks@gmail.com>
623          Lincoln D. Stein               <lstein@cshl.org>
624
625       If you are a committer to Perl and you think the patch is good, you can
626       then merge it into blead then push it out to the main repository:
627
628         % git checkout blead
629         % git merge experimental
630         % git push
631
632       If you want to delete your temporary branch, you may do so with:
633
634         % git checkout blead
635         % git branch -d experimental
636         error: The branch 'experimental' is not an ancestor of your current HEAD.
637         If you are sure you want to delete it, run 'git branch -D experimental'.
638         % git branch -D experimental
639         Deleted branch experimental.
640
641   Committing to blead
642       The 'blead' branch will become the next production release of Perl.
643
644       Before pushing any local change to blead, it's incredibly important
645       that you do a few things, lest other committers come after you with
646       pitchforks and torches:
647
648       ·   Make sure you have a good commit message. See "Commit message" in
649           perlhack for details.
650
651       ·   Run the test suite. You might not think that one typo fix would
652           break a test file. You'd be wrong. Here's an example of where not
653           running the suite caused problems. A patch was submitted that added
654           a couple of tests to an existing .t. It couldn't possibly affect
655           anything else, so no need to test beyond the single affected .t,
656           right?  But, the submitter's email address had changed since the
657           last of their submissions, and this caused other tests to fail.
658           Running the test target given in the next item would have caught
659           this problem.
660
661       ·   If you don't run the full test suite, at least "make test_porting".
662           This will run basic sanity checks. To see which sanity checks, have
663           a look in t/porting.
664
665       ·   If you make any changes that affect miniperl or core routines that
666           have different code paths for miniperl, be sure to run "make
667           minitest".  This will catch problems that even the full test suite
668           will not catch because it runs a subset of tests under miniperl
669           rather than perl.
670
671       On merging and rebasing
672
673       Simple, one-off commits pushed to the 'blead' branch should be simple
674       commits that apply cleanly.  In other words, you should make sure your
675       work is committed against the current position of blead, so that you
676       can push back to the master repository without merging.
677
678       Sometimes, blead will move while you're building or testing your
679       changes.  When this happens, your push will be rejected with a message
680       like this:
681
682         To ssh://perl5.git.perl.org/perl.git
683          ! [rejected]        blead -> blead (non-fast-forward)
684         error: failed to push some refs to 'ssh://perl5.git.perl.org/perl.git'
685         To prevent you from losing history, non-fast-forward updates were rejected
686         Merge the remote changes (e.g. 'git pull') before pushing again.  See the
687         'Note about fast-forwards' section of 'git push --help' for details.
688
689       When this happens, you can just rebase your work against the new
690       position of blead, like this (assuming your remote for the master
691       repository is "p5p"):
692
693         $ git fetch p5p
694         $ git rebase p5p/blead
695
696       You will see your commits being re-applied, and you will then be able
697       to push safely.  More information about rebasing can be found in the
698       documentation for the git-rebase(1) command.
699
700       For larger sets of commits that only make sense together, or that would
701       benefit from a summary of the set's purpose, you should use a merge
702       commit.  You should perform your work on a topic branch, which you
703       should regularly rebase against blead to ensure that your code is not
704       broken by blead moving.  When you have finished your work, please
705       perform a final rebase and test.  Linear history is something that gets
706       lost with every commit on blead, but a final rebase makes the history
707       linear again, making it easier for future maintainers to see what has
708       happened.  Rebase as follows (assuming your work was on the branch
709       "committer/somework"):
710
711         $ git checkout committer/somework
712         $ git rebase blead
713
714       Then you can merge it into master like this:
715
716         $ git checkout blead
717         $ git merge --no-ff --no-commit committer/somework
718         $ git commit -a
719
720       The switches above deserve explanation.  "--no-ff" indicates that even
721       if all your work can be applied linearly against blead, a merge commit
722       should still be prepared.  This ensures that all your work will be
723       shown as a side branch, with all its commits merged into the mainstream
724       blead by the merge commit.
725
726       "--no-commit" means that the merge commit will be prepared but not
727       committed.  The commit is then actually performed when you run the next
728       command, which will bring up your editor to describe the commit.
729       Without "--no-commit", the commit would be made with nearly no useful
730       message, which would greatly diminish the value of the merge commit as
731       a placeholder for the work's description.
732
733       When describing the merge commit, explain the purpose of the branch,
734       and keep in mind that this description will probably be used by the
735       eventual release engineer when reviewing the next perldelta document.
736
737   Committing to maintenance versions
738       Maintenance versions should only be altered to add critical bug fixes,
739       see perlpolicy.
740
741       To commit to a maintenance version of perl, you need to create a local
742       tracking branch:
743
744         % git checkout --track -b maint-5.005 origin/maint-5.005
745
746       This creates a local branch named "maint-5.005", which tracks the
747       remote branch "origin/maint-5.005". Then you can pull, commit, merge
748       and push as before.
749
750       You can also cherry-pick commits from blead and another branch, by
751       using the "git cherry-pick" command. It is recommended to use the -x
752       option to "git cherry-pick" in order to record the SHA1 of the original
753       commit in the new commit message.
754
755       Before pushing any change to a maint version, make sure you've
756       satisfied the steps in "Committing to blead" above.
757
758   Merging from a branch via GitHub
759       While we don't encourage the submission of patches via GitHub, that
760       will still happen. Here is a guide to merging patches from a GitHub
761       repository.
762
763         % git remote add avar git://github.com/avar/perl.git
764         % git fetch avar
765
766       Now you can see the differences between the branch and blead:
767
768         % git diff avar/orange
769
770       And you can see the commits:
771
772         % git log avar/orange
773
774       If you approve of a specific commit, you can cherry pick it:
775
776         % git cherry-pick 0c24b290ae02b2ab3304f51d5e11e85eb3659eae
777
778       Or you could just merge the whole branch if you like it all:
779
780         % git merge avar/orange
781
782       And then push back to the repository:
783
784         % git push
785
786   A note on camel and dromedary
787       The committers have SSH access to the two servers that serve
788       "perl5.git.perl.org". One is "perl5.git.perl.org" itself (camel), which
789       is the 'master' repository. The second one is
790       "users.perl5.git.perl.org" (dromedary), which can be used for general
791       testing and development. Dromedary syncs the git tree from camel every
792       few minutes, you should not push there. Both machines also have a full
793       CPAN mirror in /srv/CPAN, please use this. To share files with the
794       general public, dromedary serves your ~/public_html/ as
795       "http://users.perl5.git.perl.org/~yourlogin/"
796
797       These hosts have fairly strict firewalls to the outside. Outgoing, only
798       rsync, ssh and git are allowed. For http and ftp, you can use
799       http://webproxy:3128 as proxy. Incoming, the firewall tries to detect
800       attacks and blocks IP addresses with suspicious activity. This
801       sometimes (but very rarely) has false positives and you might get
802       blocked. The quickest way to get unblocked is to notify the admins.
803
804       These two boxes are owned, hosted, and operated by booking.com. You can
805       reach the sysadmins in #p5p on irc.perl.org or via mail to
806       "perl5-porters@perl.org".
807
808
809
810perl v5.16.3                      2013-03-04                        PERLGIT(1)
Impressum