Skip to main content

git-blame for stacktraces

Project description


git-stacktrace is a tool to help you associate git commits with stacktraces.

It helps you identify related commits by looking at:

  • commits in given range that touched files present in the stacktrace

  • commits in given range that added/removed code present in the stacktrace

Supported Languages


Run tests with: tox


$ pip install git_stacktrace


Run git stacktrace within a git initialized directory.

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
  --server              start a webserver to visually interact with git-
  --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

For the Python API see: git_stacktrace/

To run as a web server: git stacktrace --server --port=8080 or GIT_STACKTRACE_PORT=8080 git stacktrace --server

Use the web server as an API:

$ curl \
  -d '{"option-type":"by-date", "since":"", "trace":"..."}' \
  -H "Content-Type: application/json" \
  -X POST http://localhost:8080/


Example output:

$ git stacktrace < trace
Traceback (most recent call last):
 File "webapp/framework/", line 72, in _call
   result = getattr(self, method_name)()
 File "webapp/resources/", line 232, in get
   if self.options['from_navigate'] == "true":

commit da39a3ee5e6b4b0d3255bfef95601890afd80709
Commit Date: Tue, 19 Jul 2016 14:18:08 -0700
Author:      John Doe <>
Subject:     break interest resource
Files Modified:
   - webapp/resources/
Lines Added:
   - "if self.options['from_navigate'] == "true":"

Change Log




  • Add several missing rare git file states (T, U, X)


  • Fix pickaxe support for python3

  • Improve java traceback support

  • Improve the python api




  • Add python 3 support


  • Support arbitrary sized abbreviated hashes

  • Clarify CLI help message


  • Match file line numbers in stacktrace to lines changed in commits

  • Differentiate files added, deleted and modified

  • print stacktrace headers and footers

  • Fix git pickaxe error (Use ‘–’ to separate paths from revisions)

  • Add initial java stacktrace support. Begin supporting basic java stacktraces, some more complex formats are not supported yet.


  • Get ready for pypi


  • Initial open source commit

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git-stacktrace-1.0.0.tar.gz (34.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page