git-blame for stacktraces
项目描述
git-stacktrace
git-stacktrace是一个工具,帮助您将git提交与堆栈跟踪关联起来。
它通过查看以下内容帮助您识别相关提交:
给定范围内的提交,这些提交修改了堆栈跟踪中存在的文件
给定范围内的提交,这些提交添加/删除了堆栈跟踪中存在的代码
支持的语言
Python
Java
开发
使用:tox运行测试
安装
$ pip install git_stacktrace
用法
在git初始化的目录中运行git stacktrace。
usage: git stacktrace [<options>] [<RANGE>] < stacktrace from stdin
Lookup commits related to a given stacktrace.
positional arguments:
range git commit range to use
optional arguments:
-h, --help show this help message and exit
--since <date1> show commits more recent than a specific date (from
git-log)
--server start a webserver to visually interact with git-
stacktrace
--port PORT Server port
-f, --fast Speed things up by not running pickaxe if the file for
a line of code cannot be found
-b [BRANCH], --branch [BRANCH]
Git branch. If using --since, use this to specify
which branch to run since on. Runs on current branch
by default
--version show program's version number and exit
-d, --debug Enable debug logging
有关Python API,请参阅:git_stacktrace/api.py
作为Web服务器运行:git stacktrace --server --port=8080 或 GIT_STACKTRACE_PORT=8080 git stacktrace --server
将Web服务器用作API
$ curl \
-d '{"option-type":"by-date", "since":"1.day", "trace":"..."}' \
-H "Content-Type: application/json" \
-X POST http://localhost:8080/
示例
示例输出
$ git stacktrace --since=1.day < trace Traceback (most recent call last): File "webapp/framework/resource.py", line 72, in _call result = getattr(self, method_name)() File "webapp/resources/interests_resource.py", line 232, in get if self.options['from_navigate'] == "true": KeyError commit da39a3ee5e6b4b0d3255bfef95601890afd80709 Commit Date: Tue, 19 Jul 2016 14:18:08 -0700 Author: John Doe <johndoe@pinterest.com> Subject: break interest resource Link: https://example.com/D1000 Files Modified: - webapp/resources/interests_resource.py:232 Lines Added: - "if self.options['from_navigate'] == "true":"
变更日志
1.0.0
添加Python 3.8支持,删除Python 2.7支持(https://github.com/pinterest/git-stacktrace/pull/33)
0.9.0
增加对JavaScript的支持(https://github.com/pinterest/git-stacktrace/pull/24)
0.8.1
增加几个缺失的罕见git文件状态(T, U, X)
0.8.0
修复python3的pickaxe支持
改进Java traceback支持
改进Python API
0.7.2
修复python traceback解析,最后一行没有代码的情况(https://github.com/pinterest/git-stacktrace/pull/13)
0.7.1
修复python traceback解析中代码缺失的情况(https://github.com/pinterest/git-stacktrace/issues/10)
增加–debug标志
0.7.0
增加python 3支持
0.6.0
支持任意大小的缩写哈希值
澄清CLI帮助信息
0.5.0
匹配stacktrace中的文件行号与提交中更改的行
区分添加、删除和修改的文件
打印stacktrace的标题和页脚
修复git pickaxe错误(使用‘–’分隔路径和修订版本)
添加初始Java stacktrace支持。开始支持基本的Java stacktraces,尚未支持一些更复杂的格式。
0.4.1
准备发布到pypi
0.4.0
首次开源提交
项目详情
git-stacktrace-1.0.0.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 0100ce8d507991a9fa732d4bcc533aab7438730367e43f7ce78f10bffa059b47 |
|
MD5 | 265e032bcf4e7cc9265788e15ded74f7 |
|
BLAKE2b-256 | 77d75ce538dc17bb2ee3ee91f63bd6078722883db18b9aa56d0d62fc49cc9652 |