Acme-String-Trim

 view release on metacpan or  search on metacpan

docs/SubmittingPatches.pod  view on Meta::CPAN

=head2 Patch:

=over 4

=item * use "git format-patch -M" to create the patch

=item * do not PGP sign your patch

=item * be careful doing cut & paste, not to corrupt whitespaces.

=item * provide additional information (which is unsuitable for the commit
message) between the "---" and the diffstat

=item * if you change, add, or remove any features or make some other user
interface change, the associated documentation should be updated as well.

=item * if your name is not writable in ASCII, make sure that you send the
patch in the correct encoding.

=back

=head1 Long version:

I started reading over the SubmittingPatches document for git,
primarily because I wanted to have a document similar to it for
my projects to make sure people understand what they are doing
when they write "Signed-off-by" line.

But the patch submission requirements are a lot more relaxed
here on the technical/contents front, because my projects are
thousand times smaller ;-).  So here is only the relevant bits.

=head2 (0) Decide what to base your work on.

In general, always base your work on the oldest branch that your
change is relevant to.

=over 4

=item * A bugfix should be based on 'maint' in general. If the bug is not
present in 'maint', base it on 'master'. For a bug that's not yet
in 'master', find the topic that introduces the regression, and
base your work on the tip of the topic.

=item * A new feature should be based on 'master' in general. If the new
feature depends on a topic that is in 'pu', but not in 'master', base your
work on the tip of that topic.

=item * Corrections and enhancements to a topic not yet in 'master' should be
based on the tip of that topic. If the topic has not been merged to 'next',
it's alright to add a note to squash minor corrections into the series.

=item * In the exceptional case that a new feature depends on several topics
not in 'master', start working on 'next' or 'pu' privately and send out
patches for discussion. Before the final merge, you may have to wait until
some of the dependent topics graduate to 'master', and rebase your work.

=back

To find the tip of a topic branch, run "git log --first-parent
master..pu" and look for the merge commit. The second parent of this
commit is the tip of the topic branch.

=head2 (1) Make separate commits for logically separate changes.

Unless your patch is really trivial, you should not be sending
out a patch that was generated between your working tree and
your commit head.  Instead, always make a commit with complete
commit message and generate a series of patches from your
repository.  It is a good discipline.

Describe the technical detail of the change(s).

If your description starts to get too long, that's a sign that you
probably need to split up your commit to finer grained pieces.
That being said, patches which plainly describe the things that
help reviewers check the patch, and future maintainers understand
the code, are the most beautiful patches.  Descriptions that summarise
the point in the subject well, and describe the motivation for the
change, the approach taken by the change, and if relevant how this
differs substantially from the prior version, can be found on Usenet
archives back into the late 80's.  Consider it like good Netiquette,
but for code.

Oh, another thing.  I am picky about whitespaces.  Make sure your
changes do not trigger errors with the sample pre-commit hook shipped
in templates/hooks--pre-commit.  To help ensure this does not happen,
run git diff --check on your changes before you commit.

=head2 (2) Generate your patch using git tools out of your commits.

git based diff tools (git, Cogito, and StGIT included) generate
unidiff which is the preferred format.

You do not have to be afraid to use -M option to "git diff" or
"git format-patch", if your patch involves file renames.  The
receiving end can handle them just fine.

Please make sure your patch does not include any extra files
which do not belong in a patch submission.  Make sure to review
your patch after generating it, to ensure accuracy.  Before
sending out, please make sure it cleanly applies to the "master"
branch head.  If you are preparing a work based on "next" branch,
that is fine, but please mark it as such.

=head2 (3) Sending your patches.

People need to be able to read and comment on the changes you are
submitting.  Do not cut-n-paste your patch; you can lose
tabs that way if you are not careful.

It is a common convention to prefix your subject line with
[PATCH].  This lets people easily distinguish patches from other
e-mail discussions.  Use of additional markers after PATCH and
the closing bracket to mark the nature of the patch is also
encouraged.  E.g. [PATCH/RFC] is often used when the patch is
not ready to be applied but it is for discussion, [PATCH v2],
[PATCH v3] etc. are often seen when you are sending an update to
what you have previously sent.

You often want to add additional explanation about the patch,



( run in 1.144 second using v1.01-cache-2.11-cpan-39bf76dae61 )