Skip to content

Commit d4914e7

Browse files
committed
Address PR review: author attribution, refs chips, scan gate
- Attribute the plugin to Microbiosis (redmingwei account does not exist; gh api returns 404, so the old link was dead). Unified across both root indexes, plugin.json and both plugin READMEs. - Drop the unused refs chip row: the server never sends a per-commit refs field, so refsHtml() always returned an empty string and .row-refs / .ref-chip.is-head were dead code. Branches/tags still render in the detail panels via .ref-chip.is-tag. - Gate the whole-machine scan fallback on config.repos.length === 0 as well, so users who declared repos explicitly never trigger a drive-root scan. - Correct docs: 200 commits is a fixed client page size, not a repos.json setting; client timeout is 35s default and 60s for graph requests; expand Data & access into read / discovery / write / network sections.
1 parent 3cc348b commit d4914e7

7 files changed

Lines changed: 44 additions & 45 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The MiniMax Code Agent communicates through the host MCP client. Business reques
6363
| [Token Usage Board](plugins/yanhy2000/mcode-usage-monitor/) | Watch local Token usage, output speed, and cache hit rate in near real time; filter by time range, model, and session | [yanhy2000](https://github.com/yanhy2000) |
6464
| [Model Manager](plugins/ocoomber/openrouter-model-manager/) | Browse, search, and enable/disable models in your `~/.minimax/config.yaml` with instant save, bulk actions, one-click undo, and automatic backups | [ocoomber](https://github.com/ocoomber) |
6565
| [Self-drive Route Planner](plugins/hanzijie/self-drive-route-planner/) | **Official plugin** for planning driving routes with place search, route alternatives, demo mode, and Xiaohongshu 3:4 itinerary cards | [HanZijie](https://github.com/HanZijie) |
66-
| [Git Commit Tree](plugins/microbiosis/git-tree/) | Inspect a local Git repo's commit history with a swim-lane graph, branches/tags, commit detail, and per-file change stats; persisted filter preferences and optional auto-refresh | [redmingwei](https://github.com/redmingwei) |
66+
| [Git Commit Tree](plugins/microbiosis/git-tree/) | Inspect a local Git repo's commit history with a swim-lane graph, branches/tags, commit detail, and per-file change stats; persisted filter preferences and optional auto-refresh | [Microbiosis](https://github.com/Microbiosis) |
6767

6868
<details>
6969
<summary>Preview: Token Usage Board</summary>

‎README.zh-CN.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ MiniMax Code Agent 通过宿主 MCP 客户端与 MiniApp 协作。业务请求
6464
| [Token 用量看板](plugins/yanhy2000/mcode-usage-monitor/README.zh-CN.md) | 近实时查看本机 Token 用量、输出速度与缓存命中率,可按时间范围、模型和会话筛选 | [yanhy2000](https://github.com/yanhy2000) |
6565
| [模型管理器](plugins/ocoomber/openrouter-model-manager/README.zh-CN.md) | 浏览、搜索并启用/停用 `~/.minimax/config.yaml` 中的模型,支持即时保存、批量操作、一键撤销和自动备份 | [ocoomber](https://github.com/ocoomber) |
6666
| [自驾规划](plugins/hanzijie/self-drive-route-planner/README.zh-CN.md) | 【官方插件】规划自驾路线、地点搜索、候选算路与小红书 3:4 行程图;支持演示模式 | [HanZijie](https://github.com/HanZijie) |
67-
| [Git 提交树](plugins/microbiosis/git-tree/README.zh-CN.md) | 查看本机 Git 仓库的提交历史:泳道提交图、分支/标签、提交详情与文件改动统计,支持筛选偏好持久化与可选自动刷新 | [redmingwei](https://github.com/redmingwei) |
67+
| [Git 提交树](plugins/microbiosis/git-tree/README.zh-CN.md) | 查看本机 Git 仓库的提交历史:泳道提交图、分支/标签、提交详情与文件改动统计,支持筛选偏好持久化与可选自动刷新 | [Microbiosis](https://github.com/Microbiosis) |
6868

6969
<details>
7070
<summary>预览:Token 用量看板</summary>

‎plugins/microbiosis/git-tree/.minimax-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"displayName": "Git 提交树",
55
"version": "1.1.0",
66
"description": "查看本机 git 仓库的提交历史:泳道提交图、分支/标签、提交详情与文件改动统计。",
7-
"author": "redmingwei",
7+
"author": "Microbiosis",
88
"icon": "icon.png",
99
"category": "Other",
1010
"exampleQueries": [

‎plugins/microbiosis/git-tree/README.md‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Inspect a local Git repository's commit history from MiniMax Code: swim-lane commit graph, branches and tags, commit detail and per-file change stats, with optional auto-refresh and persisted filter preferences.
66

7-
Author: Microbiosis · Version: 1.1.0
7+
Author: [Microbiosis](https://github.com/Microbiosis) · Version: `1.1.0`
88

99
![Git commit tree preview](docs/preview.jpg)
1010

@@ -18,7 +18,7 @@ Copy this directory into the active MiniMax Code data directory under `plugins/`
1818

1919
Keep the hidden `.minimax-plugin/` directory. Restart MiniMax Code with Mini App support, confirm the plugin is recognized, then open "Git 提交树" — either from the plugin list or by asking the assistant.
2020

21-
The page loads the first 200 commits of the active repo (configurable via `repos.json`). Use the ref dropdown to filter by branch or tag, the search box to match commit subjects, the author box to match authors, and the "Auto refresh" dropdown to keep the view in sync with new pushes.
21+
The page loads the first 200 commits of the active repo. 200 is a fixed page size on the client, not a setting in `repos.json`; narrow the result set with the ref dropdown (branch or tag), the search box (commit subject), and the author box, or use "Auto refresh" to keep the view in sync with new pushes.
2222

2323
## What it shows
2424

@@ -27,8 +27,8 @@ The page loads the first 200 commits of the active repo (configurable via `repos
2727
| Stats grid | `git rev-list --all --count`, `for-each-ref`, `tag --list`, `status --porcelain` | Total commits, branches, tags, working-tree changes |
2828
| Worktree chips | `git status --porcelain` | Current branch + the first 6 changed paths |
2929
| Commit graph | `git log --topo-order` + custom lane algorithm (ported from `zai-org/ZCode`) | Single SVG canvas: paths, dots, selection ring, hover highlight |
30-
| Commit rows | `git log` + `git tag --contains` | 4-column grid (refs + subject / date / author / hash); refs chip with `is-head` and `is-tag` styling |
31-
| Inline detail (toggle) | server-side `/api/commit` | Subject, refs, file changes table, body — appears below the list and can be collapsed |
30+
| Commit rows | `git log` + `git tag --contains` | 4-column grid (subject / date / author / hash) |
31+
| Inline detail (toggle) | server-side `/api/commit` | Subject, branches/tags chips, file changes table, body — appears below the list and can be collapsed |
3232
| Right detail (always on) | server-side `/api/commit` | Same payload as inline; selection and inline are independent |
3333

3434
## Data sources & caching
@@ -39,7 +39,7 @@ The page loads the first 200 commits of the active repo (configurable via `repos
3939
- **Commit detail**: `git show -s` + `git show --numstat` + `branch --contains` + `tag --contains`, cached **60 s** per `(repo, sha)`. The client mirrors this cache for 60 s as well, so re-clicking a row is free.
4040
- **Tags for graph**: `git log --all --simplify-by-decoration --format=%H %D`, cached 60 s per repo.
4141
- **Compression**: API responses ≥ 256 bytes are gzipped when the client advertises `Accept-Encoding: gzip`.
42-
- **Timeouts**: quick reads (for-each-ref, tag --list, contains checks) 10 s; medium reads (log -n 1, status, git show) 15 s; heavy reads (log --topo-order --all, rev-list --all --count) 30 s. Client `api()` caps at 35 s with `AbortController`.
42+
- **Timeouts**: quick reads (for-each-ref, tag --list, contains checks) 10 s; medium reads (log -n 1, status, git show) 15 s; heavy reads (log --topo-order --all, rev-list --all --count) 30 s. Client `api()` caps at 35 s by default and 60 s for graph requests, using `AbortController`.
4343

4444
## Preferences
4545

@@ -68,7 +68,19 @@ No build step.
6868

6969
## Data & access
7070

71-
Every read is a local `git` invocation against a repository you declared in `repos.json` or one the scanner found on this machine. Nothing is uploaded, and the plugin makes no outbound network requests. The only write is `<dataDir>/prefs.json`, which stores just the filter and theme keys listed under Preferences.
71+
**What the plugin reads.** Every read is a local `git` invocation against a repository you declared in `repos.json` or one the scanner found on this machine. Git reads `.git` internals and working-tree metadata (for example `git status`) inside those repositories only.
72+
73+
**How repositories are discovered.** Discovery enumerates *directory names* and checks each candidate for a `.git` entry; it never reads the contents of files it is not already pointed at. The scan surface is wider than `repos.json`:
74+
75+
- Your home development directories (`~/Code`, `~/Projects`, `~/repos`, `~/workspace`, `~/src`, `~/source`, `~/dev`, `~/work`, `~/Documents`, `~/git`), plus the plugin root and process cwd walk-up.
76+
- On Windows, the root of every mounted drive letter (`A:\` … `Z:\`), which includes mapped network drives. System directories are filtered out.
77+
- On macOS and Linux, the parent of your home directory (`/Users`, `/home`), which lists the *names* of other local user accounts' home directories.
78+
79+
This only runs when neither `repos.json` nor the walk-up produced a scan base.
80+
81+
**What the plugin writes.** The only write is `<dataDir>/prefs.json`, which stores just the filter and theme keys listed under Preferences.
82+
83+
**Network.** Nothing is uploaded, and the plugin makes no outbound network requests.
7284

7385
## Tested environment
7486

‎plugins/microbiosis/git-tree/README.zh-CN.md‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
在 MiniMax Code 里查看本机 Git 仓库的提交历史:泳道提交图、分支与标签、提交详情和文件改动统计,支持自动刷新与筛选偏好持久化。
66

7-
作者:Microbiosis · 版本:`1.1.0`
7+
作者:[Microbiosis](https://github.com/Microbiosis) · 版本:`1.1.0`
88

99
![Git 提交树预览](docs/preview.jpg)
1010

@@ -18,7 +18,7 @@
1818

1919
保留 `.minimax-plugin/` 隐藏目录。重新启动支持 Mini App 的 MiniMax Code,确认插件已被识别并启用,然后打开「Git 提交树」,或在对话中请求打开它。
2020

21-
页面默认加载当前仓库最近 200 条提交(可在 `repos.json` 中配置)。通过引用下拉过滤分支或标签,用搜索框匹配提交信息,用作者框匹配作者,用「自动刷新」下拉保持视图与新推送同步。
21+
页面默认加载当前仓库最近 200 条提交。200 是客户端固定分页大小,不是 `repos.json` 里的配置项;可用引用下拉(分支或标签)、搜索框(提交信息)和作者框收窄结果,或用「自动刷新」下拉保持视图与新推送同步。
2222

2323
## 页面分区
2424

@@ -27,8 +27,8 @@
2727
| 统计卡片 | `git rev-list --all --count`、`for-each-ref`、`tag --list`、`status --porcelain` | 提交总数、分支数、标签数、工作区改动数 |
2828
| 工作区条 | `git status --porcelain` | 当前分支 + 前 6 个改动路径 chip |
2929
| 提交图 | `git log --topo-order` + 自定义泳道算法(移植自 `zai-org/ZCode`) | 单 SVG canvas:path、dot、选中环、悬停高亮 |
30-
| 提交行 | `git log` + `git tag --contains` | 4 列网格(refs+subject / date / author / hash);refs chip 用 `is-head`、`is-tag` 区分边框色 |
31-
| 行内详情(可折叠) | 服务端 `/api/commit` | 标题、refs、文件改动表、body — 出现在列表下方,可折叠 |
30+
| 提交行 | `git log` + `git tag --contains` | 4 列网格(subject / date / author / hash) |
31+
| 行内详情(可折叠) | 服务端 `/api/commit` | 标题、分支/标签 chip、文件改动表、body — 出现在列表下方,可折叠 |
3232
| 右侧详情(常驻) | 服务端 `/api/commit` | 同上行内;选中态与行内互相独立 |
3333

3434
## 数据源与缓存
@@ -39,7 +39,7 @@
3939
- **提交详情**:`git show -s` + `git show --numstat` + `branch --contains` + `tag --contains`,按 `(repo, sha)` 缓存 **60 秒**。客户端镜像同一缓存,重复点同一条提交零成本。
4040
- **图的标签**:`git log --all --simplify-by-decoration --format=%H %D`,按仓库缓存 60 秒。
4141
- **响应压缩**:API 响应 ≥ 256 字节且客户端带 `Accept-Encoding: gzip` 时自动 gzip。
42-
- **超时分级**:快速读(`for-each-ref`、`tag --list`、`--contains`)10 秒;中速读(`log -n 1`、`status`、`git show`)15 秒;重量级读(`log --topo-order --all`、`rev-list --all --count`)30 秒。客户端 `api()` 用 `AbortController` 兜底 35 秒。
42+
- **超时分级**:快速读(`for-each-ref`、`tag --list`、`--contains`)10 秒;中速读(`log -n 1`、`status`、`git show`)15 秒;重量级读(`log --topo-order --all`、`rev-list --all --count`)30 秒。客户端 `api()` 默认用 `AbortController` 兜底 35 秒,提交图请求放宽到 60 秒。
4343

4444
## 偏好持久化
4545

@@ -68,7 +68,19 @@
6868

6969
## 数据与访问
7070

71-
所有读取都是对本机仓库的本地 `git` 命令调用,仓库来自你在 `repos.json` 中声明的路径或扫描器在本机发现的目录。不上传任何数据,插件不发起任何对外网络请求。唯一的写入是 `<dataDir>/prefs.json`,只保存「偏好持久化」一节列出的筛选与主题字段。
71+
**读取范围**。所有读取都是对本机仓库的本地 `git` 命令调用,仓库来自你在 `repos.json` 中声明的路径或扫描器在本机发现的目录。`git` 只读取这些仓库内部的 `.git` 数据和工作区元数据(例如 `git status`)。
72+
73+
**仓库发现方式**。发现逻辑只枚举*目录名*并检查候选目录里是否存在 `.git` 条目,不会读取无关文件的内容。扫描面比 `repos.json` 更宽:
74+
75+
- 你的主目录下的开发目录(`~/Code`、`~/Projects`、`~/repos`、`~/workspace`、`~/src`、`~/source`、`~/dev`、`~/work`、`~/Documents`、`~/git`),以及从插件根和工作目录向上查找。
76+
- Windows 上每个已挂载盘符的根目录(`A:\` 到 `Z:\`),其中包含映射的网络驱动器;系统目录会被过滤掉。
77+
- macOS 与 Linux 上主目录的父目录(`/Users`、`/home`),这会列出本机其他用户账户的*目录名*。
78+
79+
只有在 `repos.json` 与向上查找都没有产出任何扫描基址时,才会执行上述扫描。
80+
81+
**写入范围**。唯一的写入是 `<dataDir>/prefs.json`,只保存「偏好持久化」一节列出的筛选与主题字段。
82+
83+
**网络**。不上传任何数据,插件不发起任何对外网络请求。
7284

7385
## 测试环境
7486

‎plugins/microbiosis/git-tree/miniapp/client/index.html‎

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -422,13 +422,6 @@
422422
padding-right: 8px;
423423
}
424424

425-
.row-refs {
426-
display: inline-flex;
427-
align-items: center;
428-
gap: 4px;
429-
flex: none;
430-
}
431-
432425
.ref-chip {
433426
display: inline-flex;
434427
align-items: center;
@@ -447,12 +440,6 @@
447440
white-space: nowrap;
448441
}
449442

450-
.ref-chip.is-head {
451-
border-color: var(--git-lane-0);
452-
background: var(--mcode-surface-hover);
453-
color: var(--mcode-text);
454-
}
455-
456443
.ref-chip.is-tag {
457444
border-color: var(--git-lane-2);
458445
color: var(--git-lane-2);
@@ -1205,24 +1192,9 @@ <h2>提交历史</h2>
12051192
return 'lane-color-' + (((laneIndex % 4) + 4) % 4);
12061193
}
12071194

1208-
function refsHtml(commit) {
1209-
if (!commit || !commit.refs || commit.refs.length === 0) return '';
1210-
return commit.refs.slice(0, 4).map(function (ref) {
1211-
var kindClass = ref.kind === 'head' ? ' is-head' : ref.kind === 'tag' ? ' is-tag' : '';
1212-
var icon =
1213-
ref.kind === 'tag'
1214-
? '<svg width="9" height="9" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" focusable="false"><path d="M2 3.5h10l2 2v6.5H2Zm0 0v8.5"/><circle cx="6" cy="6.5" r="1.4" fill="currentColor" stroke="none"/></svg>'
1215-
: ref.kind === 'head'
1216-
? '<svg width="9" height="9" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true" focusable="false"><circle cx="5" cy="13" r="1.4"/><path d="M5 11.6V3l7 3-7 3"/></svg>'
1217-
: '';
1218-
return '<span class="ref-chip' + kindClass + '" title="' + esc(ref.kind + ': ' + ref.name) + '">' + icon + esc(ref.name) + '</span>';
1219-
}).join('');
1220-
}
1221-
12221195
function rowHtml(commit, index) {
12231196
var selected = state.selectedSha === commit.sha;
12241197
var hoverClass = state.hoveredSha && state.hoveredSha !== commit.sha ? ' is-dimmed' : '';
1225-
var refs = refsHtml(commit);
12261198
var mergeIcon = commit.merge
12271199
? '<svg class="merge-icon" width="11" height="11" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" focusable="false"><circle cx="3" cy="3" r="1.6"/><circle cx="3" cy="13" r="1.6"/><circle cx="11" cy="6" r="1.6"/><path d="M3 4.6v6.8M4.6 13h0M11 7.6v3.5a1.6 1.6 0 0 1-1.6 1.6H7.4"/></svg>'
12281200
: '';
@@ -1232,7 +1204,6 @@ <h2>提交历史</h2>
12321204
'" data-sha="' + esc(commit.sha) + '" data-index="' + index + '">' +
12331205
'<span class="row-graph-spacer" aria-hidden="true"></span>' +
12341206
'<span class="row-subject-cell">' +
1235-
(refs ? '<span class="row-refs">' + refs + '</span>' : '') +
12361207
'<span class="row-subject" title="' + esc(commit.subject || '') + '">' + esc(commit.subject || '(无提交信息)') + '</span>' +
12371208
mergeIcon +
12381209
'</span>' +

‎plugins/microbiosis/git-tree/miniapp/node/server.mjs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,14 @@ async function buildRegistry(pluginRoot) {
304304
// drive root. This lets a fresh install on a brand-new host surface
305305
// projects without any manual configuration.
306306
//
307+
// The `config.repos.length === 0` half of the gate matters: without it a
308+
// user who listed their repos explicitly would still get a whole-disk
309+
// scan, which is far more file access than they asked for.
310+
//
307311
// On Windows the per-entry filter below drops system hives (`Program
308312
// Files`, `Users`, `Windows`, …) so widening to drive roots cannot
309313
// accidentally recurse into %ProgramFiles% or %SystemRoot%.
310-
if (scanBases.size === 0) {
314+
if (scanBases.size === 0 && config.repos.length === 0) {
311315
for (const base of discoverDefaultScanBases()) {
312316
scanBases.add(resolve(base));
313317
}

0 commit comments

Comments
 (0)