pq: rewrite patch export functionality

Use our own function for constructing the patch files instead of using
the format-patch command of git. This way, we get the desired output
format directly, without the need for the error-prone "format-patch,
parse patch files, mangle and re-write patch files" cycle.

Also, fix patch naming in patch generation when '--no-patch-numbers' is
used.  Previously, multiple commits with the same subject resulted in
multiple patches having the same filename. This lead into broken series
with missing patches as patch files were overwritten by the topmost
commit.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
pq.format_patch: support file path filtering

Implements a filter option that allows filtering out changes to certain
files/paths in the patch-generation. A commit is totally ignored if all
files would be filtered out. The path filter is given as a Python
regexp.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
pq: properly generate non-ascii patch files

Encode non-ascii email headers properly. Also, set MIME headers
correctly for the message body if the commit message body contains
non-ascii characters.

The reason for constructing the message in a little bit "clumsy" way is
the intention is to match the output of git-format-patch as closely as
possible.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
pq: support patch-export commands

Support giving commands to pq as a meta tag in commit message. The
format is "Gbp: <command> [args]".

Currently, only one command is supported. namely 'ignore'. That is, one
can use 'Gbp: Ignore' in the commit message for ignoring the commit in
patch-generation.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
pq: add format_diff() function

For generating a patch file from a diff between two arbitrary commits.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
pq: listen to 'Gbp-Pq:' commands, too

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
pq: support 'Topic' patch-export command

Topic can be defined with either 'Gbp: Topic <topic>' or 'Gbp-Pq: Topic
<topic>' in the commit message.

This is to replace the "gbp-pq-topic: <topic>" command.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
docs: update pq manpages regarding pq command meta tags

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Add zsh completion

Closes; #717002