Skip to content

Commit 875d97d

Browse files
committed
Set project in the defaultConfig
We're about to make the config required, and not implicit, therefore it makes sense to start with the project options for `gitgitgadget/git` itself. So let's set `project` explicitly in `defaultConfig` and remove the implicit configuration of the `gitgitgadget/git` project from `ProjectOptions.get()`. There is a slight quirk here, as the Git GUI special-casing is a bit magic: based on the presence of a specific file at the top-level of `HEAD`'s root tree, it is determined that this is a Git GUI PR rather than a git/git PR. Now, we _could_ introduce some new attribute of the `projectInfo` type that would allow the same kind of trick for other projects. As per gitgitgadget#1988 (comment) though, no other project using GitGitGadget may ever need that, so we'll still hard-code it for `gitgitgadget/git` (and `git/git`) specifically. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 967aab4 commit 875d97d

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

lib/gitgitgadget-config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ const defaultConfig: IConfig = {
2929
smtpUser: "[email protected]",
3030
smtpHost: "smtp.gmail.com",
3131
},
32+
project: {
33+
// The Git maintainer specifically requested not to be Cc:ed, see
34+
// b2221f4e (Stop Cc:ing the Git maintainer, 2020-01-08) for specifics,
35+
// hence no `cc: "Junio Hamano <[email protected]>"`
36+
cc: [],
37+
38+
urlPrefix: "https://lore.kernel.org/git/",
39+
},
3240
app: {
3341
appID: 12836,
3442
installationID: 195971,

lib/project-options.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,12 @@ export class ProjectOptions {
2222
for (const user of project.cc) {
2323
cc.push(user);
2424
}
25-
} else if ((await revParse(`${baseCommit}:git-gui.sh`, workDir)) !== undefined) {
26-
// Git GUI
27-
28-
cc.push("Johannes Sixt <[email protected]>");
29-
} else if ((await revParse(`${baseCommit}:git.c`, workDir)) !== undefined) {
30-
// Git
31-
32-
// Do *not* Cc: Junio Hamano by default
33-
midUrlPrefix = "https://lore.kernel.org/git/";
25+
// Hard-code a check for gitgitgadget/git whether this is a Git GUI PR
26+
// and hence needs the Git GUI maintainer to be Cc:ed
27+
if (
28+
`${config.repo.owner}/${config.repo.name}` === "gitgitgadget/git" &&
29+
(await revParse(`${baseCommit}:git-gui.sh`, workDir)) !== undefined
30+
) {
3431
} else if ((await revParse(`${baseCommit}:winsup`, workDir)) !== undefined) {
3532
// Cygwin
3633

0 commit comments

Comments
 (0)