mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
feat(rtk): add JS-native git-log filter (#2423)
Compress git log output via dedicated RTK filter: keep commit headers, Author/Date, subject; drop body padding, decoration, embedded diff lines. Wire into autodetect (git-log prioritized before git-diff) and registry. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
decolua
co-authored by
Cursor
parent
bbae990b92
commit
19281b5524
@@ -4,6 +4,7 @@ import { describe, it, expect } from "vitest";
|
||||
import { autoDetectFilter } from "../../open-sse/rtk/autodetect.js";
|
||||
import { buildOutput } from "../../open-sse/rtk/filters/buildOutput.js";
|
||||
import { gitDiff } from "../../open-sse/rtk/filters/gitDiff.js";
|
||||
import { gitLog } from "../../open-sse/rtk/filters/gitLog.js";
|
||||
import { gitStatus } from "../../open-sse/rtk/filters/gitStatus.js";
|
||||
import { safeApply } from "../../open-sse/rtk/applyFilter.js";
|
||||
import { compressMessages } from "../../open-sse/rtk/index.js";
|
||||
@@ -279,6 +280,41 @@ describe("PR #1175 - integration with compressMessages", () => {
|
||||
});
|
||||
});
|
||||
|
||||
// ============================================================
|
||||
// 6.5. GIT-LOG PRIORITY
|
||||
// ============================================================
|
||||
describe("git-log priority", () => {
|
||||
it("git-log chosen over build-output when commit header present in first window", () => {
|
||||
const input = [
|
||||
"commit abc1234def5678abc1234def5678abc1234def5",
|
||||
"Author: Dev One <dev1@example.com>",
|
||||
"Date: Sun Jul 6 10:00:00 2026 +0700",
|
||||
"",
|
||||
" Add auth middleware",
|
||||
"",
|
||||
"diff --git a/src/auth.js b/src/auth.js",
|
||||
"index abc..def 100644",
|
||||
"--- a/src/auth.js",
|
||||
"+++ b/src/auth.js",
|
||||
"@@ -1 +1 @@",
|
||||
"+new line"
|
||||
].join("\n");
|
||||
expect(autoDetectFilter(input)).toBe(gitLog);
|
||||
});
|
||||
|
||||
it("pure git diff still stays git-diff", () => {
|
||||
const input = [
|
||||
"diff --git a/src/auth.js b/src/auth.js",
|
||||
"index abc..def 100644",
|
||||
"--- a/src/auth.js",
|
||||
"+++ b/src/auth.js",
|
||||
"@@ -1 +1 @@",
|
||||
"+new line"
|
||||
].join("\n");
|
||||
expect(autoDetectFilter(input)).toBe(gitDiff);
|
||||
});
|
||||
});
|
||||
|
||||
// ============================================================
|
||||
// 7. PORCELAIN REGRESSION DEEPER TESTS
|
||||
// ============================================================
|
||||
|
||||
Reference in New Issue
Block a user