This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Make sure no future ambiguity on new alpha assertions
[perl5.git] / pod / perlgit.pod
index f5d4fec..000d6ac 100644 (file)
@@ -107,31 +107,33 @@ files, and in addition it will show things like what files have been
 staged for the next commit, and usually some useful information about
 how to change things. For instance the following:
 
-  $ git status
-  # On branch blead
-  # Your branch is ahead of 'origin/blead' by 1 commit.
-  #
-  # Changes to be committed:
-  #   (use "git reset HEAD <file>..." to unstage)
-  #
-  #       modified:   pod/perlgit.pod
-  #
-  # Changed but not updated:
-  #   (use "git add <file>..." to update what will be committed)
-  #
-  #       modified:   pod/perlgit.pod
-  #
-  # Untracked files:
-  #   (use "git add <file>..." to include in what will be committed)
-  #
-  #       deliberate.untracked
+ % git status
+ On branch blead
+ Your branch is ahead of 'origin/blead' by 1 commit.
+
+ Changes to be committed:
+   (use "git reset HEAD <file>..." to unstage)
+
+       modified:   pod/perlgit.pod
+
+ Changes not staged for commit:
+   (use "git add <file>..." to update what will be committed)
+   (use "git checkout -- <file>..." to discard changes in working
+                                                              directory)
+
+       modified:   pod/perlgit.pod
+
+ Untracked files:
+   (use "git add <file>..." to include in what will be committed)
+
+       deliberate.untracked
 
 This shows that there were changes to this document staged for commit,
 and that there were further changes in the working directory not yet
 staged. It also shows that there was an untracked file in the working
 directory, and as you can see shows how to change all of this. It also
 shows that there is one commit on the working branch C<blead> which has
-not been pushed to the C<origin> remote yet. B<NOTE>: that this output
+not been pushed to the C<origin> remote yet. B<NOTE>: This output
 is also what you see as a template if you do not provide a message to
 C<git commit>.
 
@@ -177,35 +179,34 @@ to Orange Brocard, we should change his name in the AUTHORS file:
 You can see what files are changed:
 
   % git status
-  # On branch orange
-  # Changes to be committed:
-  #   (use "git reset HEAD <file>..." to unstage)
-  #
-  #    modified:   AUTHORS
-  #
+  On branch orange
+  Changes to be committed:
+    (use "git reset HEAD <file>..." to unstage)
+
+     modified:   AUTHORS
 
 And you can see the changes:
 
 % git diff
 diff --git a/AUTHORS b/AUTHORS
 index 293dd70..722c93e 100644
 --- a/AUTHORS
 +++ b/AUTHORS
 @@ -541,7 +541,7 @@    Lars Hecking                   <lhecking@nmrc.ucc.ie>
-   Laszlo Molnar                  <laszlo.molnar@eth.ericsson.se>
-   Leif Huhn                      <leif@hale.dkstat.com>
-   Len Johnson                    <lenjay@ibm.net>
 -Leon Brocard                   <acme@astray.com>
 +Orange Brocard                 <acme@astray.com>
-   Les Peters                     <lpeters@aol.net>
-   Lesley Binks                   <lesley.binks@gmail.com>
-   Lincoln D. Stein               <lstein@cshl.org>
+ % git diff
+ diff --git a/AUTHORS b/AUTHORS
+ index 293dd70..722c93e 100644
+ --- a/AUTHORS
+ +++ b/AUTHORS
@@ -541,7 +541,7 @@    Lars Hecking              <lhecking@nmrc.ucc.ie>
+  Laszlo Molnar                  <laszlo.molnar@eth.ericsson.se>
+  Leif Huhn                      <leif@hale.dkstat.com>
+  Len Johnson                    <lenjay@ibm.net>
+ -Leon Brocard                   <acme@astray.com>
+ +Orange Brocard                 <acme@astray.com>
+  Les Peters                     <lpeters@aol.net>
+  Lesley Binks                   <lesley.binks@gmail.com>
+  Lincoln D. Stein               <lstein@cshl.org>
 
 Now commit your change locally:
 
 % git commit -a -m 'Rename Leon Brocard to Orange Brocard'
 Created commit 6196c1d: Rename Leon Brocard to Orange Brocard
-   1 files changed, 1 insertions(+), 1 deletions(-)
+ % git commit -a -m 'Rename Leon Brocard to Orange Brocard'
+ Created commit 6196c1d: Rename Leon Brocard to Orange Brocard
+  1 files changed, 1 insertions(+), 1 deletions(-)
 
 The C<-a> option is used to include all files that git tracks that you
 have changed. If at this time, you only want to commit some of the
@@ -225,20 +226,20 @@ Once you've finished writing your commit message and exited your
 editor, git will write your change to disk and tell you something like
 this:
 
 Created commit daf8e63: explain git status and stuff about remotes
-   1 files changed, 83 insertions(+), 3 deletions(-)
+ Created commit daf8e63: explain git status and stuff about remotes
+  1 files changed, 83 insertions(+), 3 deletions(-)
 
 If you re-run C<git status>, you should see something like this:
 
 % git status
-  # On branch blead
-  # Your branch is ahead of 'origin/blead' by 2 commits.
-  #
-  # Untracked files:
-  #   (use "git add <file>..." to include in what will be committed)
-  #
-  #       deliberate.untracked
-  nothing added to commit but untracked files present (use "git add" to track)
+ % git status
+ On branch orange
+ Untracked files:
+   (use "git add <file>..." to include in what will be committed)
+
+       deliberate.untracked
+
+ nothing added to commit but untracked files present (use "git add" to
+                                                                  track)
 
 When in doubt, before you do anything else, check your status and read
 it carefully, many questions are answered directly by the git status
@@ -276,12 +277,12 @@ patch emails|/Sending patch emails> for more information.
 
 If you want to delete your temporary branch, you may do so with:
 
 % git checkout blead
 % git branch -d orange
 error: The branch 'orange' is not an ancestor of your current HEAD.
 If you are sure you want to delete it, run 'git branch -D orange'.
 % git branch -D orange
 Deleted branch orange.
+ % git checkout blead
+ % git branch -d orange
+ error: The branch 'orange' is not an ancestor of your current HEAD.
+ If you are sure you want to delete it, run 'git branch -D orange'.
+ % git branch -D orange
+ Deleted branch orange.
 
 =head2 Committing your changes
 
@@ -303,20 +304,22 @@ Once you've finished writing your commit message and exited your
 editor, git will write your change to disk and tell you something like
 this:
 
 Created commit daf8e63: explain git status and stuff about remotes
-   1 files changed, 83 insertions(+), 3 deletions(-)
+ Created commit daf8e63: explain git status and stuff about remotes
+  1 files changed, 83 insertions(+), 3 deletions(-)
 
 If you re-run C<git status>, you should see something like this:
 
-  % git status
-  # On branch blead
-  # Your branch is ahead of 'origin/blead' by 2 commits.
-  #
-  # Untracked files:
-  #   (use "git add <file>..." to include in what will be committed)
-  #
-  #       deliberate.untracked
-  nothing added to commit but untracked files present (use "git add" to track)
+ % git status
+ On branch blead
+ Your branch is ahead of 'origin/blead' by 2 commits.
+   (use "git push" to publish your local commits)
+ Untracked files:
+   (use "git add <file>..." to include in what will be committed)
+
+       deliberate.untracked
+
+ nothing added to commit but untracked files present (use "git add" to
+                                                                  track)
 
 When in doubt, before you do anything else, check your status and read
 it carefully, many questions are answered directly by the git status
@@ -324,23 +327,27 @@ output.
 
 =head2 Sending patch emails
 
-After you've generated your patch you should sent it
-to perlbug@perl.org (as discussed L<in the previous
-section|/"Patch workflow">) with a normal mail client as an
+After you've generated your patch you should send it
+to L<perlbug@perl.org|mailto:perlbug@perl.org> (as discussed L<in the
+previous section|/"Patch workflow">) with a normal mail client as an
 attachment, along with a description of the patch.
 
 You B<must not> use git-send-email(1) to send patches generated with
 git-format-patch(1). The RT ticketing system living behind
-perlbug@perl.org does not respect the inline contents of E-Mails,
-sending an inline patch to RT guarantees that your patch will be
-destroyed.
+L<perlbug@perl.org|mailto:perlbug@perl.org> does not respect the inline
+contents of E-Mails, sending an inline patch to RT guarantees that your
+patch will be destroyed.
 
 Someone may download your patch from RT, which will result in the
-subject (the first line of the commit message) being omitted.  See RT
-#74192 and commit a4583001 for an example. Alternatively someone may
+subject (the first line of the commit message) being omitted.  See
+L<RT #74192|https://rt.perl.org/Ticket/Display.html?id=74192> and
+L<commit a4583001|http://perl5.git.perl.org/perl.git/commitdiff/a4583001>
+for an example. Alternatively someone may
 apply your patch from RT after it arrived in their mailbox, by which
-time RT will have modified the inline content of the message.  See RT
-#74532 and commit f9bcfeac for a bad example of this failure mode.
+time RT will have modified the inline content of the message.  See
+L<RT #74532|https://rt.perl.org/Ticket/Display.html?id=74532> and
+L<commit f9bcfeac|http://perl5.git.perl.org/perl.git/commitdiff/f9bcfeac>
+for a bad example of this failure mode.
 
 =head2 A note on derived files
 
@@ -349,10 +356,10 @@ patching them, because git won't see the changes to them, and the build
 process will overwrite them. Patch the originals instead. Most
 utilities (like perldoc) are in this category, i.e. patch
 F<utils/perldoc.PL> rather than F<utils/perldoc>. Similarly, don't
-create patches for files under $src_root/ext from their copies found in
-$install_root/lib. If you are unsure about the proper location of a
-file that may have gotten copied while building the source
-distribution, consult the C<MANIFEST>.
+create patches for files under F<$src_root/ext> from their copies found
+in F<$install_root/lib>. If you are unsure about the proper location of
+file that may have gotten copied while building the source
+distribution, consult the F<MANIFEST>.
 
 =head2 Cleaning a working directory
 
@@ -368,7 +375,7 @@ However, be aware this will delete ALL untracked content. You can use
   % git clean -Xf
 
 to remove all ignored untracked files, such as build and test
-byproduct, but leave any  manually created files alone.
+byproduct, but leave any manually created files alone.
 
 If you only want to cancel some uncommitted edits, you can use C<git
 checkout> and give it a list of files to be reverted, or C<git checkout
@@ -394,8 +401,8 @@ you simply run this:
 
     .../Porting/bisect.pl -e 'my $a := 2;'
 
-Using C<bisect.pl>, with one command (and no other files) it's easy to find
-out
+Using F<Porting/bisect.pl>, with one command (and no other files) it's easy to
+find out
 
 =over 4
 
@@ -418,8 +425,8 @@ Which commit removed the last file to match this regex?
 =back
 
 usually without needing to know which versions of perl to use as start and
-end revisions, as F<bisect.pl> automatically searches to find the earliest
-stable version for which the test case passes. Run
+end revisions, as F<Porting/bisect.pl> automatically searches to find the
+earliest stable version for which the test case passes. Run
 C<Porting/bisect.pl --help> for the full documentation, including how to
 set the C<Configure> and build time options.
 
@@ -474,23 +481,30 @@ the "first commit where the bug is solved".
 C<git help bisect> has much more information on how you can tweak your
 binary searches.
 
+Following bisection you may wish to configure, build and test perl at
+commits identified by the bisection process.  Sometimes, particularly
+with older perls, C<make> may fail during this process.  In this case
+you may be able to patch the source code at the older commit point.  To
+do so, please follow the suggestions provided in
+L<perlhack/Building perl at older commits>.
+
 =head2 Topic branches and rewriting history
 
 Individual committers should create topic branches under
 B<yourname>/B<some_descriptive_name>:
 
-  $ branch="$yourname/$some_descriptive_name"
-  $ git checkout -b $branch
+  % branch="$yourname/$some_descriptive_name"
+  % git checkout -b $branch
   ... do local edits, commits etc ...
-  $ git push origin -u $branch
+  % git push origin -u $branch
 
 Should you be stuck with an ancient version of git (prior to 1.7), then
 C<git push> will not have the C<-u> switch, and you have to replace the
 last step with the following sequence:
 
-  $ git push origin $branch:refs/heads/$branch
-  $ git config branch.$branch.remote origin
-  $ git config branch.$branch.merge refs/heads/$branch
+  % git push origin $branch:refs/heads/$branch
+  % git config branch.$branch.remote origin
+  % git config branch.$branch.merge refs/heads/$branch
 
 If you want to make changes to someone else's topic branch, you should
 check with its creator before making any change to it.
@@ -520,20 +534,20 @@ in the git push documentation for details) after you have rebased your
 branch:
 
   # first rebase
-  $ git checkout $user/$topic
-  $ git fetch
-  $ git rebase origin/blead
+  % git checkout $user/$topic
+  % git fetch
+  % git rebase origin/blead
 
   # then "delete-and-push"
-  $ git push origin :$user/$topic
-  $ git push origin $user/$topic
+  % git push origin :$user/$topic
+  % git push origin $user/$topic
 
 B<NOTE:> it is forbidden at the repository level to delete any of the
 "primary" branches. That is any branch matching
 C<m!^(blead|maint|perl)!>. Any attempt to do so will result in git
 producing an error like this:
 
-  $ git push origin :blead
+  % git push origin :blead
   *** It is forbidden to delete blead/maint branches in this repository
   error: hooks/update exited with error code 1
   error: hook declined to update refs/heads/blead
@@ -561,7 +575,7 @@ this is now impossible to fix in the public repository. You can remove
 this mis-merge locally by adding the following line to your
 C<.git/info/grafts> file:
 
 296f12bbbbaa06de9be9d09d3dcf8f4528898a49 434946e0cb7a32589ed92d18008aaa1d88515930
+ 296f12bbbbaa06de9be9d09d3dcf8f4528898a49 434946e0cb7a32589ed92d18008aaa1d88515930
 
 It is particularly important to have this graft line if any bisecting
 is done in the area of the "merge" in question.
@@ -580,7 +594,7 @@ this once globally in their F<~/.gitconfig> by doing something like:
   % git config --global user.name "Ævar Arnfjörð Bjarmason"
   % git config --global user.email avarab@gmail.com
 
-However, if you'd like to override that just for perl, 
+However, if you'd like to override that just for perl,
 execute something like the following in F<perl>:
 
   % git config user.email avar@cpan.org
@@ -608,47 +622,49 @@ you should try out the patch.
 First we need to create a temporary new branch for these changes and
 switch into it:
 
 % git checkout -b experimental
+ % git checkout -b experimental
 
 Patches that were formatted by C<git format-patch> are applied with
 C<git am>:
 
 % git am 0001-Rename-Leon-Brocard-to-Orange-Brocard.patch
 Applying Rename Leon Brocard to Orange Brocard
+ % git am 0001-Rename-Leon-Brocard-to-Orange-Brocard.patch
+ Applying Rename Leon Brocard to Orange Brocard
 
 Note that some UNIX mail systems can mess with text attachments containing
 'From '. This will fix them up:
 
-  % perl -pi -e's/^>From /From /' 0001-Rename-Leon-Brocard-to-Orange-Brocard.patch
+ % perl -pi -e's/^>From /From /' \
+                        0001-Rename-Leon-Brocard-to-Orange-Brocard.patch
 
 If just a raw diff is provided, it is also possible use this two-step
 process:
 
-  % git apply bugfix.diff
-  % git commit -a -m "Some fixing" --author="That Guy <that.guy@internets.com>"
+ % git apply bugfix.diff
+ % git commit -a -m "Some fixing" \
+                            --author="That Guy <that.guy@internets.com>"
 
 Now we can inspect the change:
 
 % git show HEAD
 commit b1b3dab48344cff6de4087efca3dbd63548ab5e2
 Author: Leon Brocard <acme@astray.com>
 Date:   Fri Dec 19 17:02:59 2008 +0000
-
-    Rename Leon Brocard to Orange Brocard
-
 diff --git a/AUTHORS b/AUTHORS
 index 293dd70..722c93e 100644
 --- a/AUTHORS
 +++ b/AUTHORS
 @@ -541,7 +541,7 @@ Lars Hecking                        <lhecking@nmrc.ucc.ie>
-   Laszlo Molnar                  <laszlo.molnar@eth.ericsson.se>
-   Leif Huhn                      <leif@hale.dkstat.com>
-   Len Johnson                    <lenjay@ibm.net>
 -Leon Brocard                   <acme@astray.com>
 +Orange Brocard                 <acme@astray.com>
-   Les Peters                     <lpeters@aol.net>
-   Lesley Binks                   <lesley.binks@gmail.com>
-   Lincoln D. Stein               <lstein@cshl.org>
+ % git show HEAD
+ commit b1b3dab48344cff6de4087efca3dbd63548ab5e2
+ Author: Leon Brocard <acme@astray.com>
+ Date:   Fri Dec 19 17:02:59 2008 +0000
+
+   Rename Leon Brocard to Orange Brocard
+
+ diff --git a/AUTHORS b/AUTHORS
+ index 293dd70..722c93e 100644
+ --- a/AUTHORS
+ +++ b/AUTHORS
@@ -541,7 +541,7 @@ Lars Hecking                 <lhecking@nmrc.ucc.ie>
+  Laszlo Molnar                  <laszlo.molnar@eth.ericsson.se>
+  Leif Huhn                      <leif@hale.dkstat.com>
+  Len Johnson                    <lenjay@ibm.net>
+ -Leon Brocard                   <acme@astray.com>
+ +Orange Brocard                 <acme@astray.com>
+  Les Peters                     <lpeters@aol.net>
+  Lesley Binks                   <lesley.binks@gmail.com>
+  Lincoln D. Stein               <lstein@cshl.org>
 
 If you are a committer to Perl and you think the patch is good, you can
 then merge it into blead then push it out to the main repository:
@@ -659,12 +675,13 @@ then merge it into blead then push it out to the main repository:
 
 If you want to delete your temporary branch, you may do so with:
 
-  % git checkout blead
-  % git branch -d experimental
-  error: The branch 'experimental' is not an ancestor of your current HEAD.
-  If you are sure you want to delete it, run 'git branch -D experimental'.
-  % git branch -D experimental
-  Deleted branch experimental.
+ % git checkout blead
+ % git branch -d experimental
+ error: The branch 'experimental' is not an ancestor of your current
+ HEAD.  If you are sure you want to delete it, run 'git branch -D
+ experimental'.
+ % git branch -D experimental
+ Deleted branch experimental.
 
 =head2 Committing to blead
 
@@ -686,8 +703,8 @@ message> for details.
 Run the test suite. You might not think that one typo fix would break a
 test file. You'd be wrong. Here's an example of where not running the
 suite caused problems. A patch was submitted that added a couple of
-tests to an existing .t. It couldn't possibly affect anything else, so
-no need to test beyond the single affected .t, right?  But, the
+tests to an existing F<.t>. It couldn't possibly affect anything else, so
+no need to test beyond the single affected F<.t>, right?  But, the
 submitter's email address had changed since the last of their
 submissions, and this caused other tests to fail. Running the test
 target given in the next item would have caught this problem.
@@ -718,19 +735,20 @@ Sometimes, blead will move while you're building or testing your
 changes.  When this happens, your push will be rejected with a message
 like this:
 
-  To ssh://perl5.git.perl.org/perl.git
-   ! [rejected]        blead -> blead (non-fast-forward)
-  error: failed to push some refs to 'ssh://perl5.git.perl.org/perl.git'
-  To prevent you from losing history, non-fast-forward updates were rejected
-  Merge the remote changes (e.g. 'git pull') before pushing again.  See the
-  'Note about fast-forwards' section of 'git push --help' for details.
+ To ssh://perl5.git.perl.org/perl.git
+  ! [rejected]        blead -> blead (non-fast-forward)
+ error: failed to push some refs to 'ssh://perl5.git.perl.org/perl.git'
+ To prevent you from losing history, non-fast-forward updates were
+ rejected Merge the remote changes (e.g. 'git pull') before pushing
+ again.  See the 'Note about fast-forwards' section of 'git push --help'
+ for details.
 
 When this happens, you can just I<rebase> your work against the new
 position of blead, like this (assuming your remote for the master
 repository is "p5p"):
 
-  $ git fetch p5p
-  $ git rebase p5p/blead
+  % git fetch p5p
+  % git rebase p5p/blead
 
 You will see your commits being re-applied, and you will then be able to
 push safely.  More information about rebasing can be found in the
@@ -748,14 +766,14 @@ again, making it easier for future maintainers to see what has
 happened.  Rebase as follows (assuming your work was on the
 branch C<< committer/somework >>):
 
-  $ git checkout committer/somework
-  $ git rebase blead
+  % git checkout committer/somework
+  % git rebase blead
 
 Then you can merge it into master like this:
 
-  $ git checkout blead
-  $ git merge --no-ff --no-commit committer/somework
-  $ git commit -a
+  % git checkout blead
+  % git merge --no-ff --no-commit committer/somework
+  % git commit -a
 
 The switches above deserve explanation.  C<--no-ff> indicates that even
 if all your work can be applied linearly against blead, a merge commit
@@ -834,6 +852,9 @@ on other OSes test the change before you commit it to blead.
 Fortunately, there is a way to get your change smoke-tested on various
 OSes: push it to a "smoke-me" branch and wait for certain automated
 smoke-testers to report the results from their OSes.
+A "smoke-me" branch is identified by the branch name: specifically, as
+seen on perl5.git.perl.org it must be a local branch whose first name
+component is precisely C<smoke-me>.
 
 The procedure for doing this is roughly as follows (using the example of
 of tonyc's smoke-me branch called win32stat):
@@ -888,9 +909,10 @@ Finally, you should then delete the remote smoke-me branch:
 
 (which is likely to produce a warning like this, which can be ignored:
 
-  remote: fatal: ambiguous argument 'refs/heads/smoke-me/tonyc/win32stat':
-  unknown revision or path not in the working tree.
-  remote: Use '--' to separate paths from revisions
+ remote: fatal: ambiguous argument
+                                  'refs/heads/smoke-me/tonyc/win32stat':
+ unknown revision or path not in the working tree.
+ remote: Use '--' to separate paths from revisions
 
 ) and then delete your local branch:
 
@@ -904,17 +926,17 @@ which is the 'master' repository. The second one is
 C<users.perl5.git.perl.org> (I<dromedary>), which can be used for
 general testing and development. Dromedary syncs the git tree from
 camel every few minutes, you should not push there. Both machines also
-have a full CPAN mirror in /srv/CPAN, please use this. To share files
-with the general public, dromedary serves your ~/public_html/ as
-C<http://users.perl5.git.perl.org/~yourlogin/>
+have a full CPAN mirror in F</srv/CPAN>, please use this. To share files
+with the general public, dromedary serves your F<~/public_html/> as
+C<L<http://users.perl5.git.perl.org/~yourlogin/>>
 
 These hosts have fairly strict firewalls to the outside. Outgoing, only
 rsync, ssh and git are allowed. For http and ftp, you can use
-http://webproxy:3128 as proxy. Incoming, the firewall tries to detect
+L<http://webproxy:3128> as proxy. Incoming, the firewall tries to detect
 attacks and blocks IP addresses with suspicious activity. This
 sometimes (but very rarely) has false positives and you might get
 blocked. The quickest way to get unblocked is to notify the admins.
 
 These two boxes are owned, hosted, and operated by booking.com. You can
 reach the sysadmins in #p5p on irc.perl.org or via mail to
-C<perl5-porters@perl.org>.
+L<perl5-porters@perl.org|mailto:perl5-porters@perl.org>.