pw-apply: export ADD_TAGS based on replies to cover letter

Patchwork does not automatically propagate tags from cover letter.
With a few simple REST calls we can get all the comments and grep
them for tags.

We export those tags to a env var called ADD_TAGS.

User is expected to add to their applypatch-msg hook something like:

    while IFS= read -r tag; do
	echo -e Adding tag: '\e[35m'$tag'\e[0m'
	git interpret-trailers --in-place \
	    --if-exists=addIfDifferent \
	    --trailer "$tag" \
    done <<< "$ADD_TAGS"

Signed-off-by: Jakub Kicinski <>
Signed-off-by: Daniel Borkmann <>
1 file changed