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: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
Ahmet Alp Balkan 2018-05-28 11:00:49 -07:00
Родитель 865b3f34f8
Коммит 2c9de69120
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 5C02521D7B216AD6
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -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)