Skip to content

Commit fb0dd6a

Browse files
committed
WIP ProjectOptions: retire the publishToRemote attribute
It's been made obsolete by the removal of the CLI. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 8478b5f commit fb0dd6a

File tree

4 files changed

+5
-22
lines changed

4 files changed

+5
-22
lines changed

lib/patch-series.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable security/detect-unsafe-regex */
22
import addressparser from "nodemailer/lib/addressparser/index.js";
33
import mimeFuncs from "nodemailer/lib/mime-funcs/index.js";
4-
import { commitExists, git, gitConfig, gitShortHash, revListCount, revParse } from "./git.js";
4+
import { commitExists, git, gitShortHash, revListCount, revParse } from "./git.js";
55
import { GitNotes } from "./git-notes.js";
66
import { IGitGitGadgetOptions } from "./gitgitgadget.js";
77
import { IMailMetadata } from "./mail-metadata.js";
@@ -138,9 +138,7 @@ export class PatchSeries {
138138
throw new Error(`Cannot find base branch ${basedOn}`);
139139
}
140140

141-
const publishToRemote: string | undefined = undefined;
142-
143-
const project = await ProjectOptions.get(config, workDir, headCommit, cc, baseCommit, basedOn, publishToRemote);
141+
const project = await ProjectOptions.get(config, workDir, headCommit, cc, baseCommit, basedOn);
144142
if (rangeDiff) {
145143
options.rangeDiff = rangeDiff;
146144
}
@@ -639,7 +637,7 @@ export class PatchSeries {
639637
this.metadata.coverLetterMessageId = coverMid;
640638

641639
logger.log("Generating tag message");
642-
let tagMessage = PatchSeries.generateTagMessage(
640+
const tagMessage = PatchSeries.generateTagMessage(
643641
mails[0],
644642
mails.length > 1,
645643
this.project.midUrlPrefix,
@@ -657,16 +655,6 @@ export class PatchSeries {
657655

658656
this.metadata.latestTag = tagName;
659657

660-
if (this.project.publishToRemote) {
661-
const url = await gitConfig(`remote.${this.project.publishToRemote}.url`, this.project.workDir);
662-
if (!url) {
663-
throw new Error(`remote ${this.project.publishToRemote} lacks URL`);
664-
}
665-
666-
logger.log("Inserting links");
667-
tagMessage = PatchSeries.insertLinks(tagMessage, url, tagName, this.project.basedOn);
668-
}
669-
670658
if (this.options.noUpdate) {
671659
logger.log(
672660
`Would generate tag ${tagName} with message:\n\n ${tagMessage

lib/project-options.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export class ProjectOptions {
99
cc: string[],
1010
baseCommit: string,
1111
basedOn?: string,
12-
publishToRemote?: string,
1312
): Promise<ProjectOptions> {
1413
const to = `--to=${config.project.to}`;
1514
const midUrlPrefix = config.project.urlPrefix;
@@ -25,13 +24,12 @@ export class ProjectOptions {
2524
cc.push("Johannes Sixt <[email protected]>");
2625
}
2726

28-
return new ProjectOptions(branchName, basedOn, publishToRemote, to, cc, midUrlPrefix, workDir, baseCommit);
27+
return new ProjectOptions(branchName, basedOn, to, cc, midUrlPrefix, workDir, baseCommit);
2928
}
3029

3130
public readonly branchName: string;
3231
public readonly baseCommit: string;
3332
public readonly basedOn?: string;
34-
public readonly publishToRemote?: string;
3533
public readonly workDir: string;
3634

3735
public readonly to: string;
@@ -41,7 +39,6 @@ export class ProjectOptions {
4139
protected constructor(
4240
branchName: string,
4341
basedOn: string | undefined,
44-
publishToRemote: string | undefined,
4542
to: string,
4643
cc: string[],
4744
midUrlPrefix: string,
@@ -53,7 +50,6 @@ export class ProjectOptions {
5350
this.baseCommit = baseCommit;
5451

5552
this.basedOn = basedOn;
56-
this.publishToRemote = publishToRemote;
5753
this.workDir = workDir;
5854

5955
this.to = to;

tests/patch-series.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class PatchSeriesTest extends PatchSeries {
9595
};
9696
class ProjectOptionsTest extends ProjectOptions {
9797
public constructor() {
98-
super("", "", "", "", [], "", "", "");
98+
super("", "", "", [], "", "", "");
9999
}
100100
}
101101

tests/project-options.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ test("project options", async () => {
2929
["Nguyễn Thái Ngọc Duy <[email protected]>"],
3030
"test-project-options^",
3131
undefined,
32-
undefined,
3332
);
3433
expect(options2.workDir).not.toBeUndefined();
3534
expect(options2.midUrlPrefix).toEqual("https://dummy.com/?mid=");

0 commit comments

Comments
 (0)