Skip to main content

word-by-word blame for git

Project description


Show word-by-word authors of a file


Executing git word-blame git.c on the git repository we get:


pip install git-word-blame


git word-blame <path/to/my/file>

It will produce the following files (by default in /tmp/git-word-blame/):

- author_stats.tsv         # top authors by number of characters attributed to them
- commit_stats.tsv          # same for commits
- word-blame-by-commit.html # hover on some text to see which commit created it
- word-blame-by-author.html # same for authors
- text-output # tokens grouped by authors as a grep-friendly output

Authorship algorithms

Two algorithms are available:

  • wikiwho (default): coarse but more robust
  • mwpersistence: precise but with more false-positives

To change the engine used by git word-blame:

git config --global word-blame.engine mwpersistence

HTML output

You can choose between 3 themes for the HTML output: black-and-white, solarized-dark, solarized-light.

git config --global word-blame.theme solarized-dark

By default a git command is shown when clicking on the text, you can change this behavior and make it go to the diff online (Github/Framagit) directly:

git config --global --bool true


git-word-blame doesn't support renames for now and is only tested on files with a linear history.

There's also a default maxmum of 2000 commits processed. This can be removed with this command: git config --global word-blame.limit 0.

WikiWho does not yet, to my knowledge, support attributing white-space, it's attributed to the token coming after it.

See also

Project details

Download files

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

Files for git-word-blame, version 0.0.7
Filename, size File type Python version Upload date Hashes
Filename, size git_word_blame-0.0.7-py3-none-any.whl (19.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size git-word-blame-0.0.7.tar.gz (6.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page