diff --git a/package.json b/package.json index 7fb168bbd..c79d19163 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,11 @@ "license": "MIT", "repository": { "type": "git", - "url": "git+https://github.com/glittercowboy/gsd-pi.git" + "url": "https://github.com/gsd-build/gsd-2.git" }, - "homepage": "https://github.com/glittercowboy/gsd-pi#readme", + "homepage": "https://github.com/gsd-build/gsd-2#readme", "bugs": { - "url": "https://github.com/glittercowboy/gsd-pi/issues" + "url": "https://github.com/gsd-build/gsd-2/issues" }, "type": "module", "workspaces": [ diff --git a/src/resources/extensions/gsd/git-service.ts b/src/resources/extensions/gsd/git-service.ts index c984e6606..89c20dd7d 100644 --- a/src/resources/extensions/gsd/git-service.ts +++ b/src/resources/extensions/gsd/git-service.ts @@ -205,13 +205,27 @@ export function writeIntegrationBranch(basePath: string, milestoneId: string, br // ─── Git Helper ──────────────────────────────────────────────────────────── -/** Env overlay that suppresses all interactive git credential prompts. */ +/** Env overlay that suppresses interactive git credential prompts and git-svn noise. */ const GIT_NO_PROMPT_ENV = { ...process.env, GIT_TERMINAL_PROMPT: "0", GIT_ASKPASS: "", + GIT_SVN_ID: "", }; +/** + * Strip git-svn noise from error messages. + * Some systems (notably Arch Linux) have a buggy git-svn Perl module that + * emits warnings on every git invocation, confusing users. See #404. + */ +function filterGitSvnNoise(message: string): string { + return message + .replace(/Duplicate specification "[^"]*" for option "[^"]*"\n?/g, "") + .replace(/Unable to determine upstream SVN information from .*\n?/g, "") + .replace(/Perhaps the repository is empty\. at .*git-svn.*\n?/g, "") + .trim(); +} + /** * Run a git command in the given directory. * Returns trimmed stdout. Throws on non-zero exit unless allowFailure is set. @@ -229,7 +243,7 @@ export function runGit(basePath: string, args: string[], options: { allowFailure } catch (error) { if (options.allowFailure) return ""; const message = error instanceof Error ? error.message : String(error); - throw new Error(`git ${args.join(" ")} failed in ${basePath}: ${message}`); + throw new Error(`git ${args.join(" ")} failed in ${basePath}: ${filterGitSvnNoise(message)}`); } } diff --git a/src/resources/extensions/gsd/native-git-bridge.ts b/src/resources/extensions/gsd/native-git-bridge.ts index 851547b41..e613409a5 100644 --- a/src/resources/extensions/gsd/native-git-bridge.ts +++ b/src/resources/extensions/gsd/native-git-bridge.ts @@ -7,11 +7,12 @@ import { execSync } from "node:child_process"; -/** Env overlay that suppresses all interactive git credential prompts. */ +/** Env overlay that suppresses interactive git credential prompts and git-svn noise. */ const GIT_NO_PROMPT_ENV = { ...process.env, GIT_TERMINAL_PROMPT: "0", GIT_ASKPASS: "", + GIT_SVN_ID: "", }; let nativeModule: { diff --git a/src/resources/extensions/gsd/worktree-manager.ts b/src/resources/extensions/gsd/worktree-manager.ts index edbec38eb..12955c9ee 100644 --- a/src/resources/extensions/gsd/worktree-manager.ts +++ b/src/resources/extensions/gsd/worktree-manager.ts @@ -46,13 +46,27 @@ export interface WorktreeDiffSummary { // ─── Git Helpers ─────────────────────────────────────────────────────────── -/** Env overlay that suppresses all interactive git credential prompts. */ +/** Env overlay that suppresses interactive git credential prompts and git-svn noise. */ const GIT_NO_PROMPT_ENV = { ...process.env, GIT_TERMINAL_PROMPT: "0", GIT_ASKPASS: "", + GIT_SVN_ID: "", }; +/** + * Strip git-svn noise from error messages. + * Some systems have a buggy git-svn Perl module that emits warnings + * on every git invocation. See #404. + */ +function filterGitSvnNoise(message: string): string { + return message + .replace(/Duplicate specification "[^"]*" for option "[^"]*"\n?/g, "") + .replace(/Unable to determine upstream SVN information from .*\n?/g, "") + .replace(/Perhaps the repository is empty\. at .*git-svn.*\n?/g, "") + .trim(); +} + function runGit(cwd: string, args: string[], opts: { allowFailure?: boolean } = {}): string { try { return execSync(`git ${args.join(" ")}`, { @@ -64,7 +78,7 @@ function runGit(cwd: string, args: string[], opts: { allowFailure?: boolean } = } catch (error) { if (opts.allowFailure) return ""; const message = error instanceof Error ? error.message : String(error); - throw new Error(`git ${args.join(" ")} failed in ${cwd}: ${message}`); + throw new Error(`git ${args.join(" ")} failed in ${cwd}: ${filterGitSvnNoise(message)}`); } }