This commit is contained in:
Jabberwocky238
2026-07-29 06:51:43 -04:00
parent 68cda1972c
commit 319f5dd148
64 changed files with 4952 additions and 2186 deletions
+20
View File
@@ -76,6 +76,21 @@ HTTP 鉴权完全闭环在 simplegit 内部,符合"数据库只跟自己通"
---
## Git hooks
所有 Git hook 统一执行一个策略脚本:
```text
hook.sh <hook-type> <owner/name> [Git hook 原始参数...]
```
脚本继承 hook 的 stdin 和 `GIT_*` 环境。daemon 默认使用工作目录或二进制旁的
`hook.sh`;本地开发可以直接修改默认脚本,生产环境通过
`-hook-script=/path/to/production-hook.sh` 替换。simplegit 不解释或转发 hook
事件,具体效果完全由该脚本负责。
---
## 目录结构
```
@@ -83,12 +98,17 @@ cmd/ 入口、HTTP/SSH listener、host store
gitcmd/ git 仓库操作(tree/blob/commit/branch/merge/...
gitrpc/ Connect-RPC server + 鉴权 middleware + clientv1 proto 与生成码
common/ 仓库路径解析(repolayout
hook.sh 默认 Git hook 策略脚本
db/ 私有数据库(规划中)
updater/ 更新器(规划中)
build/ 构建产物
tests/ 集成测试
```
## 开发约束
- `state/` 内不允许放置任何 `_test.go` 文件。涉及 state 的行为验证必须放在 `state/` 之外的测试目录中。
---
## 实现状态