Development using git:Creating patches: Difference between revisions

From Alpine Linux
(fix link to configuring smtp auth)
(better explanation of --no-chain-reply-to)
Line 21: Line 21:
{{Note|The git send-email command is provided by the '''git-email''' package ('''git-perl''' in v2.7 and older). }}
{{Note|The git send-email command is provided by the '''git-email''' package ('''git-perl''' in v2.7 and older). }}


See [[Development using git#Email_configuration]] on how configure SMTP Auth.
Read [[Development using git]] to send patch with SMTP Auth.


== Multiple commits with 'git send-email' ==
== Multiple commits with 'git send-email' ==
Line 36: Line 36:


This will produce the patches for each local commit in the directory "patches" and send them.
This will produce the patches for each local commit in the directory "patches" and send them.
Use --no-chain-reply-to make sure it doesn't reply.
Use '''--no-chain-reply-to''' to avoid that each patch is sent as a ''reply'' to the previous patch.


<!-- what does the following mean? -->
Eg.
Don't do:
* [PATCH 0/m]
* [PATCH 0/m]
** [PATCH 1/m]
** [PATCH 1/m]
*** [PATCH 2/m]
*** [PATCH 2/m]
**** ...
**** ...
But do:
 
With the option '''--no-chain-reply-to''' the patches will be sent as a reply to the first email, the ''cover letter'' (the [PATCH 0/m]) and will make the email thread nicer.
Like this:
* [PATCH 0/m]
* [PATCH 0/m]
** [PATCH 1/m]
** [PATCH 1/m]

Revision as of 11:14, 7 June 2015

Patches should be created with git and submitted to alpine-aports mailing list with git send-email.

Only the last commit with 'git send-email'

To submit the last commit as a patch to alpine-aports mailing list:

git send-email --to alpine-aports@lists.alpinelinux.org HEAD^

The first line in commit message will be subject and the long description (separated with empty line) will be the body in the email. The example below shows

testing/packagename: new aport  <- Subject line

Enter some details about your package <- Mail body
here if you like and an url where to find more information

http://example.com/packagename

Note: The git send-email command is provided by the git-email package (git-perl in v2.7 and older).

Read Development using git to send patch with SMTP Auth.

Multiple commits with 'git send-email'

If you have many commits you can create a directory with patches and send them with git send-email.

rm -Rf patches mkdir patches git format-patch -o patches origin git send-email patches --compose --no-chain-reply-to --to alpine-aports@lists.alpinelinux.org

You can also format patches for the last x number of commits with:

git format-patch -x -o patches

This will produce the patches for each local commit in the directory "patches" and send them. Use --no-chain-reply-to to avoid that each patch is sent as a reply to the previous patch.

Eg.

  • [PATCH 0/m]
    • [PATCH 1/m]
      • [PATCH 2/m]
        • ...

With the option --no-chain-reply-to the patches will be sent as a reply to the first email, the cover letter (the [PATCH 0/m]) and will make the email thread nicer. Like this:

  • [PATCH 0/m]
    • [PATCH 1/m]
    • [PATCH 2/m]
    • ..