findmissing: gerrit_interface: Reference originating commit if there is no BUG

If we are generating a CL against a previous commit into a ChromeOS branch,
and the offending patch does not have a BUG= entry or specifies BUG=None,
we want to have a reference against that CL in the commit message.

While at it, select last instead of first BUG= and TEST= message, in the
assumption that the last message in the file (if there is more than one)
is more relevant than the first.

BUG=None
TEST=Run on GCE

Change-Id: Ic466e213c091187e1ae61c922b4eec73c7b513a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2200138
Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
Commit-Queue: Guenter Roeck <groeck@chromium.org>
Tested-by: Guenter Roeck <groeck@chromium.org>
1 file changed