From ee6e61df81cc84039cac40d216e18f9599ad8c3e Mon Sep 17 00:00:00 2001 From: Romain Cascino Date: Mon, 8 Jun 2026 15:38:59 +0200 Subject: [PATCH] Set maxBuffer on runLog to avoid ENOBUFS on large commit ranges --- src/git.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/git.ts b/src/git.ts index 893fa4a..579a98e 100644 --- a/src/git.ts +++ b/src/git.ts @@ -382,11 +382,16 @@ export function ensureCommitAvailable(sha: string, cwd: string = process.cwd()): ); } +// A wide commit range outgrows Node's 1 MB default; keep a finite ceiling +// rather than Infinity to bound memory. +const RUN_LOG_MAX_BUFFER = 256 * 1024 * 1024; + function runLog(rangeArgs: string, cwd: string): CommitContext[] { const output = execSync(`git log --format=%H%x1f%B%x1f%D%x1e ${rangeArgs}`, { cwd, stdio: ["ignore", "pipe", "pipe"], encoding: "utf8", + maxBuffer: RUN_LOG_MAX_BUFFER, }); return output .split("\x1e")