pull-request: Hide Signed-off-by

Fixes #1724.

This patch omits the "Signed-off-by:" line coming from pull requests created
out of single commit messages. This way the user does not need to manually
remove their email address from the PR description.

Not introducing a flag for this as it applies to only one case (single-commit
diff between heads, as well as no -m/-f/-i specified).

Meta: sending this PR with the patched build, my Signed-off-by line is removed
automatically from the PR message.
Signed-off-by: NAhmet Alp Balkan <ahmetb@google.com>
上级 865b3f34
......@@ -252,6 +252,9 @@ of text is the title and the rest is the description.`, fullBase, fullHead))
if len(commits) == 1 {
message, err = git.Show(commits[0])
utils.Check(err)
re := regexp.MustCompile(`(?m)\n^Signed-off-by:\s.*$`)
message = re.ReplaceAllString(message, "")
} else if len(commits) > 1 {
commitLogs, err = git.Log(baseTracking, headForMessage)
utils.Check(err)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册