-
Notifications
You must be signed in to change notification settings - Fork 114
Description
Before #163 the only way of specifying multiple CC's was to have them on the same line without trailing newline.
Some developers seem to have found that approach, for example:
gitgitgadget/git#450
gitgitgadget/git#428
gitgitgadget/git#415
However, doing so can "eat" the first CC, I myself ran into this problem in gitgitgadget/git#490
The problem is demonstrated by this test:
test("multiple CC's in one line", () => {
const multipleCCs = "Some Dev <dev@example.com>, Some Other Dev <other@example.com>, Another Dev <another@example.com>";
const encoded = PatchSeries.encodeSender(multipleCCs);
const expected = "\"Some Dev\" <dev@example.com>, Some Other Dev <other@example.com>, Another Dev <another@example.com>"
expect(encoded).toEqual(expected);
});
The results are (formatted for ease of reading)
"Some Dev <dev@example.com>, Some Other Dev" <other@example.com>,
Another Dev <another@example.com>
There, the first mail was quoted and therefore ignored. Also, it seems that neither GitGitGadget nor git format-patch expect multiple items in one go. It "worked" by coincidence.
One solution is to split multi-email Cc: footer in parsePullRequestBody(), so that the rest of GitGitGadget works with expected single-mail items. Splitting could be non-trivial, though, because in worst case there could be some name with a comma like "Someone, the team leader" <teamlead@example.com>.
An alternative solution is to forbid using multiple emails in one Cc:, simply detecting multiple @ should be good enough.