11import { revParse } from "./git.js" ;
2- import { IConfig , projectInfo } from "./project-config.js" ;
2+ import { IConfig } from "./project-config.js" ;
33
4- // For now, only the Git, Cygwin and BusyBox projects are supported
54export class ProjectOptions {
65 public static async get (
76 config : IConfig ,
@@ -12,30 +11,18 @@ export class ProjectOptions {
1211 basedOn ?: string ,
1312 publishToRemote ?: string ,
1413 ) : Promise < ProjectOptions > {
15- let to : string ;
16- let midUrlPrefix = " Message-ID: " ;
17-
18- if ( Object . prototype . hasOwnProperty . call ( config , "project" ) ) {
19- const project = config . project as projectInfo ;
20- to = `--to=${ project . to } ` ;
21- midUrlPrefix = project . urlPrefix ;
22- cc . push ( ...project . cc ) ;
23- // Hard-code a check for gitgitgadget/git whether this is a Git GUI PR
24- // and hence needs the Git GUI maintainer to be Cc:ed
25- if (
26- `${ config . repo . owner } /${ config . repo . name } ` === "gitgitgadget/git" &&
27- ( await revParse ( `${ baseCommit } :git-gui.sh` , workDir ) ) !== undefined
28- ) {
29- } else if ( ( await revParse ( `${ baseCommit } :winsup` , workDir ) ) !== undefined ) {
30- // Cygwin
31- to = "--to=cygwin-patches@cygwin.com" ;
32- midUrlPrefix = "https://www.mail-archive.com/search?l=cygwin-patches@cygwin.com&q=" ;
33- } else if ( ( await revParse ( `${ baseCommit } :include/busybox.h` , workDir ) ) !== undefined ) {
34- // BusyBox
35- to = "--to=busybox@busybox.net" ;
36- midUrlPrefix = "https://www.mail-archive.com/search?l=busybox@busybox.net&q=" ;
37- } else {
38- throw new Error ( "Unrecognized project" ) ;
14+ const to = `--to=${ config . project . to } ` ;
15+ const midUrlPrefix = config . project . urlPrefix ;
16+ cc . push ( ...config . project . cc ) ;
17+
18+ // Hard-code a check for gitgitgadget/git whether this is a Git GUI PR
19+ // and hence needs the Git GUI maintainer to be Cc:ed
20+ if (
21+ `${ config . repo . owner } /${ config . repo . name } ` === "gitgitgadget/git" &&
22+ ( await revParse ( `${ baseCommit } :git-gui.sh` , workDir ) ) !== undefined
23+ ) {
24+ // Git GUI
25+ cc . push ( "Johannes Sixt <j6t@kdbg.org>" ) ;
3926 }
4027
4128 return new ProjectOptions ( branchName , basedOn , publishToRemote , to , cc , midUrlPrefix , workDir , baseCommit ) ;
0 commit comments