Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/mail-archive-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ export class MailArchiveGitHelper {
if (!sousChef.messageID) {
throw new Error(`Could not parse Message-ID of ${mbox}`);
}
console.log(`Handling "${sousChef.subject}"`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noting that in the unlikely event subject is not found the log will say:

  console.log
    Handling "undefined"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right... Still better than saying nothing at all ;-)

const whatsCookingBaseURL = "https://lore.kernel.org/git/";
for (const branchName of Object.keys(sousChef.branches)) {
for (const branchName of sousChef.branches.keys()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I missed this (I had updated in my local test branch). May need to look at creating tests for MailArchiveGitHelper.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be nice. I am not quite comfortable yet adding these tests...

const pullRequestURL = branchNameMap.get(branchName);
if (pullRequestURL) {
const branchBaseURL
Expand Down
6 changes: 5 additions & 1 deletion lib/sous-chef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
export class SousChef {
public readonly mbox: string;
public readonly messageID: string | undefined;
public readonly subject: string | undefined;
public readonly branches = new Map<string, {
merged: string | undefined;
sectionName: string;
Expand All @@ -25,7 +26,7 @@ export class SousChef {
.match(/([^ ]+).*\n *(\(merged to [^)]+\))?/m);
if (!match) {
continue
};
}

const branchName = match[1];
const merged = match[2];
Expand All @@ -38,5 +39,8 @@ export class SousChef {
const messageIDMatch =
`\n${sections[0]}`.match(/\nMessage-ID: <([^>]+)>/i)
this.messageID = messageIDMatch?.[1];
const subjectMatch =
`\n${sections[0]}`.match(/\nSubject: (.*)/i)
this.subject = subjectMatch?.[1];
}
}