From 95393afde8acdcac3d3e1de26fd7bcadf0ce47f1 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 22 Jan 2024 15:36:37 +0100 Subject: [PATCH] [FIX] runbot_merge: extraction of authorship info during rebase Turns out I've always been mistaken about the handling of quotes *inside* shell parameters, apparently they are always consumed by the shell unless nested so --foo="bar" reaches the underlying program as --foo=bar This means when using subprocess (without shell=True), adding the quotes leads to mishandling of the parameters (as the subprocess now has quotes it's not equipped to deal with). This exact error is made in the `--pretty` parameter of git show, locally this results in the author name and the committer email being terminated by double quotes although somehow other layers seem to exclude those from the end result (I assume `commit-tree` strips the quotes from the envvars under the assumption that users can mistakenly quote them or something? Anyway while it does not seem harmful (so far), better safe than sorry. --- runbot_merge/git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runbot_merge/git.py b/runbot_merge/git.py index ead0e6f1..73ad9d73 100644 --- a/runbot_merge/git.py +++ b/runbot_merge/git.py @@ -160,7 +160,7 @@ class Repo: mapping = {} for original, tree in zip(commits, new_trees): - authorship = check(repo.show('--no-patch', '--pretty="%an%n%ae%n%ai%n%cn%n%ce"', original['sha'])) + authorship = check(repo.show('--no-patch', '--pretty=%an%n%ae%n%ai%n%cn%n%ce', original['sha'])) author_name, author_email, author_date, committer_name, committer_email =\ authorship.stdout.splitlines()