summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Widen <andreas@harmonicflow.org>2016-02-16 18:16:16 +0100
committerAndreas Widen <andreas@harmonicflow.org>2016-02-16 18:16:16 +0100
commit2563c85900e661271abbac3bdad04ec39afdbbe5 (patch)
treebd1936ffccb09c176a0726a6a2e4b0c07f4e1794
parent205d63dbef6bd40fa7b6b0a37ac88e3b83a37b42 (diff)
downloadHarmonicFlowOrgWeb-2563c85900e661271abbac3bdad04ec39afdbbe5.tar.xz
HarmonicFlowOrgWeb-2563c85900e661271abbac3bdad04ec39afdbbe5.zip
New blog post: How to submit a patch.
Signed-off-by: Andreas Widen <andreas@harmonicflow.org>
-rw-r--r--blog/data/2016-02-16-17:36:22-how-to-submit-a-patch.txt190
1 files changed, 190 insertions, 0 deletions
diff --git a/blog/data/2016-02-16-17:36:22-how-to-submit-a-patch.txt b/blog/data/2016-02-16-17:36:22-how-to-submit-a-patch.txt
new file mode 100644
index 0000000..810ded7
--- /dev/null
+++ b/blog/data/2016-02-16-17:36:22-how-to-submit-a-patch.txt
@@ -0,0 +1,190 @@
+Title: How to submit a patch
+Tags: git-tutorial, how-to-submit-a-patch
+Date: 2016-02-16 17:36:22
+Format: markdown
+
+You can convert git commits into patch files and send those to the email
+address listed on the [contact page](/contact.php).
+
+You can also host repositories yourself and send the checkout details, along
+with information on which commits in what branch contain your changes.
+__CUT__
+
+## Setting up the repository
+
+Clone the repository:
+
+<pre>
+$ git clone https://git.harmonicflow.org/repos/HarmonicFlowFramework.git
+</pre>
+
+Make sure to checkout **development** branch:
+
+<pre>
+$ git checkout development
+</pre>
+
+If you already have the repository cloned, make sure it's up-to-date:
+
+<pre>
+$ git pull origin development
+</pre>
+
+It's wise to create another branch based on **development** for the
+specific feature you're working on:
+
+<pre>
+$ git checkout -b fix001 development
+</pre>
+
+Do some work and add to staging area:
+
+<pre>
+$ git add NEWS
+</pre>
+
+Commit the change (-s adds Signed-off-by: Your Name <email@example.org>):
+
+<pre>
+$ git commit -s
+</pre>
+
+## Method 1. Creating a patch with git format-patch
+
+Check the log for your change:
+
+<pre>
+$ git log --pretty=oneline -3
+b3683636ba23b39fdb63df14398b104fc5e90849 Updated NEWS file with 0.5.0 version info.
+fcfd83ec066713fe8bd4c743f06f94c45ef1dca4 Updated http to https.
+f9d907d8482970cd1cf62b93d531b02281eca75f Makefile.am: Include docs/ folder.
+</pre>
+
+Create a single patch:
+
+<pre>
+$ git format-patch -1 b3683636ba23b39fdb63df14398b104fc5e90849
+0001-Updated-NEWS-file-with-0.5.0-version-info.patch
+</pre>
+
+Create patches for the 3 last commits:
+
+<pre>
+$ git format-patch -3
+0001-Makefile.am-Include-docs-folder.patch
+0002-Updated-http-to-https.patch
+0003-Updated-NEWS-file-with-0.5.0-version-info.patch
+</pre>
+
+Create patches for a given range:
+
+<pre>
+$ git format-patch -2 fcfd83ec066713fe8bd4c743f06f94c45ef1dca4
+0001-Makefile.am-Include-docs-folder.patch
+0002-Updated-http-to-https.patch
+</pre>
+
+Create patches for a given range:
+
+<pre>
+$ git format-patch f9d907d8482970cd1cf62b93d531b02281eca75f..b3683636ba23b39fdb63df14398b104fc5e90849
+0001-Updated-http-to-https.patch
+0002-Updated-NEWS-file-with-0.5.0-version-info.patch
+</pre>
+
+A complete list of git format-patch options can be found here:<br>
+[https://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html](https://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html)
+
+Send the resulting '**.patch**' file/s to the email address listed on the
+[contact page](/contact.php). Just add the patches as attachments.
+
+## Method 2. Creating and sending a patch with git send-email
+
+Make sure you've the following settings configured:
+
+<pre>
+$ git config --global sendemail.smtpuser email@example.org
+$ git config --global sendemail.smtpserver smtp.example.org
+$ git config --global sendemail.smtpencryption tls
+$ git config --global sendemail.smtpserverport 465
+</pre>
+
+You can also configure your password doing:
+
+<pre>
+$ git config --global sendemail.smtppass yourpassword12345
+</pre>
+
+However, that is not recommended since your password will be written
+unencrypted in ~/.gitconfig. This command has been included just for
+completeness.
+
+I'm personally using [msmtp](http://msmtp.sourceforge.net/) and then you only
+need this setting:
+
+<pre>
+$ git config --global sendemail.smtpserver /usr/bin/msmtp
+</pre>
+
+Read more about msmtp here:<br>
+[http://msmtp.sourceforge.net/](http://msmtp.sourceforge.net/)
+
+Every time a patch is sent, your mail address is CC’ed by default. To prevent
+git send-email from sending you back copies of your emails, do:
+
+<pre>
+$ git config --global sendemail.suppresscc self
+</pre>
+
+Now, before proceeding with git send-email options, try to send the patch
+series to your email account by doing:
+
+<pre>
+$ git send-email --to email@example.org ~/patches/*.patch
+</pre>
+
+Example sending last commit:
+
+<pre>
+$ git send-email -1 --to=email@example.org
+</pre>
+
+Example sending last 3 commits:
+
+<pre>
+$ git send-email -3 --to=email@example.org
+</pre>
+
+Example sending range:
+
+<pre>
+$ git send-email f9d907d8482970cd1cf62b93d531b02281eca75f..b3683636ba23b39fdb63df14398b104fc5e90849 --to=email@example.org
+</pre>
+
+Change 'email@example.org' to the email address listed on the [contact
+page](/contact.php).
+
+A complete list of git send-email options can be found here:<br>
+[https://www.kernel.org/pub/software/scm/git/docs/git-send-email.html](https://www.kernel.org/pub/software/scm/git/docs/git-send-email.html)
+
+## Method 3. Host repositories yourself
+
+You can also host repositories yourself and send the checkout details, along
+with information on which commits in what branch contain your changes.
+
+## Recommended reading
+
+See [Git Basic Setup](/blog/git_basic_setup.php) for a tutorial on how to
+setup Git.
+
+See [Git Basic Usage](/blog/git_basic_usage.php) for a tutorial on how to
+use Git.
+
+A complete list of git format-patch options can be found here:<br>
+[https://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html](https://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html)
+
+A complete list of git send-email options can be found here:<br>
+[https://www.kernel.org/pub/software/scm/git/docs/git-send-email.html](https://www.kernel.org/pub/software/scm/git/docs/git-send-email.html)
+
+Read more about msmtp here:<br>
+[http://msmtp.sourceforge.net/](http://msmtp.sourceforge.net/)