Git Log Summary
生成Markdown格式的Git提交记录摘要报告。使用场景:当用户需要按照Markdown格式输出git仓库的详细统计信息时使用此技能。输出内容包括:项目信息、分支信息、提交统计、作者统计、最近提交记录、分支信息和提交类型统计等,全部以标准Markdown格式呈现。
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 0 · 38 · 0 current installs · 0 all-time installs
MIT-0
Security Scan
OpenClaw
Suspicious
medium confidencePurpose & Capability
The skill's name/description (generate Markdown git commit summaries) matches the provided scripts' behavior. However the registry metadata declares no required binaries while the scripts clearly require git and other standard Unix tools (bc, sed, awk-like utilities). This mismatch between declared requirements and actual needs is an incoherence the user should be aware of.
Instruction Scope
SKILL.md instructs running the included scripts (local and remote). The scripts stick to git-related operations (reading repo history, cloning remote repos, writing a report file). They do not call external web endpoints other than performing git clone on a user-supplied URL. However the remote script executes a local script via eval with user-influenced parameters (OUTPUT_FILE/REPO_URL) which introduces potential shell-injection risk if untrusted inputs are supplied. The remote script also clones arbitrary URLs supplied by the user—this is expected for its purpose but increases attack surface when run against untrusted repos.
Install Mechanism
No install spec; this is an instruction-only skill with included shell scripts. Nothing is downloaded or installed by the skill itself (lowest install risk).
Credentials
No environment variables or credentials are requested. The scripts read git metadata and repository content only, which is appropriate for the described functionality.
Persistence & Privilege
always is false and the skill does not request persistent/global privileges. It does create (and optionally remove) a temporary clone directory when analyzing remote repos, which is within the expected scope.
What to consider before installing
This skill appears to perform the advertised task, but take these precautions before running it:
- Ensure you have git and common Unix utilities (git, bc, sed, coreutils) available—the package metadata does not declare these but the scripts require them.
- Review the scripts locally before running. Pay attention to the remote script's use of eval to invoke the local analysis script with user-supplied arguments—avoid passing untrusted values for -o (output file) or -u (repo URL) to prevent shell injection.
- When analyzing remote repositories, only clone repositories you trust or run the script inside an isolated environment (container, VM, or sandbox) because cloning untrusted repos can expose your environment to malicious content or unexpected large data.
- If you will run this in automated contexts, consider replacing the eval invocation with a safe exec (avoid eval, pass arguments as an array) and sanitize user inputs.
If you want to proceed safely, run the scripts manually in a disposable container first and inspect generated files and logs.Like a lobster shell, security has layers — review code before you run it.
Current versionv1.0.0
Download ziplatest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
SKILL.md
Git Log Summary Skill (Markdown格式)
此技能用于生成Markdown格式的Git提交记录摘要报告,适合文档化、分享和在线阅读。
快速开始
基本用法
生成当前git仓库的Markdown格式提交记录摘要:
./scripts/generate_git_summary.sh
输出格式示例
# 项目名 Git提交记录摘要
## 报告信息
- **生成时间**: 2026-03-25 20:03:35
- **仓库路径**: `/path/to/repository`
- **仓库基本信息**:
- **Git版本**: 2.39.5
- **仓库创建时间**: 2026-03-05
- **最后提交时间**: 2026-03-25
## 分支信息
### 当前分支
`master`
### 远程仓库
- origin https://example.com/repo.git (fetch)
- origin https://example.com/repo.git (push)
## 提交统计
### 总提交数
**总提交数**: 30
### 按作者统计
| 作者 | 提交次数 | 占比 |
|------|----------|------|
| user1 | 21 | 70.00% |
| user2 | 7 | 23.33% |
## 最近提交记录
显示最近 20 条提交记录:
| Commit Hash | 作者 | 提交时间 | 提交日志 |
|-------------|------|----------|----------|
| abc123 | user1 | 3 hours ago | feat: 新增功能 |
| def456 | user2 | 5 hours ago | fix: 修复问题 |
## 所有分支
### 本地分支
- master
- feature-branch
### 远程分支
- origin/HEAD
- origin/master
## 提交类型统计
基于最近1000条提交信息的类型分析:
| 类型 | 数量 | 占比 | 说明 |
|------|------|------|------|
| feat | 27 | 90.0% | 新功能 |
| fix | 2 | 6.7% | Bug修复 |
---
*报告生成完成*
脚本功能
主要脚本
scripts/generate_git_summary.sh - Markdown格式脚本,生成完整的git提交记录摘要
功能特性
-
项目信息提取:
- 自动获取项目名称(从git remote或目录名)
- 获取仓库路径和基本信息
- 记录生成时间
-
分支信息:
- 当前分支
- 远程仓库信息
- 所有分支列表
-
提交统计:
- 总提交数
- 按作者统计提交次数和占比(Markdown表格格式)
- 提交类型统计(feat, fix, merge等)
-
详细提交记录:
- 最近提交的详细记录(Markdown表格格式)
- 格式化输出:Commit Hash | 作者 | 提交时间 | 提交日志
-
提交类型分析:
- 自动分析提交信息中的类型前缀
- 统计各类提交的数量和占比
- 提供类型说明
使用示例
# 生成默认报告(自动保存为 项目名-git-log-年月日-时分秒.md)
./scripts/generate_git_summary.sh
# 指定输出文件
./scripts/generate_git_summary.sh -o custom-report.md
# 限制最近提交数量
./scripts/generate_git_summary.sh -n 20
# 包含所有分支的统计
./scripts/generate_git_summary.sh -a
# 组合使用
./scripts/generate_git_summary.sh -n 15 -a
自动文件名格式
当不指定-o参数时,脚本会自动生成文件名:
项目名-git-log-年月日-时分秒.md
示例:
long-shop-git-log-20260325-203045.md
文件名组成:
- 项目名: 从git remote或目录名自动提取
- git-log: 固定标识
- 年月日: 报告生成日期(如20260325)
- 时分秒: 报告生成时间(如203045)
远程仓库分析
远程分析脚本
scripts/generate_git_summary_remote.sh - 专门用于分析远程Git仓库
功能特性
- 自动克隆: 自动克隆远程仓库到临时目录
- 保留报告: 生成报告后保留报告文件
- 可选保留: 可选择保留或删除克隆的仓库
- 完整分析: 包含所有本地分析功能
远程仓库使用示例
# 分析远程仓库(自动生成报告文件)
./scripts/generate_git_summary_remote.sh -u https://gitee.com/forever_1236/long-shop.git
# 指定输出文件
./scripts/generate_git_summary_remote.sh -u https://gitee.com/user/repo.git -o my-report.md
# 保留克隆的仓库目录
./scripts/generate_git_summary_remote.sh -u https://github.com/user/repo.git -k
# 组合使用
./scripts/generate_git_summary_remote.sh -u https://gitee.com/user/repo.git -n 30 -a -o report.md
脚本参数
本地分析脚本 (generate_git_summary.sh)
-o, --output <file>: 指定输出文件(默认自动生成:项目名-git-log-年月日-时分秒.md)-n, --num-commits <number>: 指定显示的最近提交数量(默认20)-a, --all-branches: 包含所有分支的统计(默认只统计当前分支)-h, --help: 显示帮助信息
远程分析脚本 (generate_git_summary_remote.sh)
-u, --url <url>: 远程Git仓库URL(必需)-o, --output <file>: 指定输出文件(默认自动生成)-n, --num-commits <number>: 指定显示的最近提交数量(默认20)-a, --all-branches: 包含所有分支的统计(默认只统计当前分支)-k, --keep-clone: 保留克隆的仓库目录(默认不保留)-h, --help: 显示帮助信息
提交类型识别
脚本会自动识别以下提交类型:
feat: 新功能fix: Bug修复merge: 合并分支docs: 文档更新style: 代码格式调整refactor: 代码重构test: 测试相关chore: 构建过程或辅助工具变动perf: 性能优化ci: CI/CD相关build: 构建系统revert: 回退提交
注意事项
- 确保在git仓库中: 脚本必须在git仓库目录下运行
- git版本: 需要git 1.8.0或更高版本
- 权限: 需要读取git配置和提交历史的权限
- 大型仓库: 对于大型仓库,统计所有提交可能需要较长时间
故障排除
常见问题
-
"错误:当前目录不是git仓库":
- 确保当前目录是git仓库
- 运行
git init初始化新仓库
-
统计不准确:
- 运行
git fetch --all更新远程分支信息 - 使用
-a参数包含所有分支统计
- 运行
-
提交类型识别错误:
- 检查提交信息是否符合约定格式(如 "feat: 添加新功能")
- 调整脚本中的类型匹配规则
性能优化
对于大型仓库:
- 使用
-n参数限制最近提交数量 - 避免使用
-a参数除非必要 - 考虑使用
git log --since限制时间范围
Files
3 totalSelect a file
Select a file to preview.
Comments
Loading comments…
