Skip to main content

git-word-blame

Show word-by-word authors of a file

Demo

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

Installation

pip install git-word-blame

Usage

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 word-blame.link-to-online-commit true

Limits

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

Release files for git-word-blame 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-word-blame 0.0.7
File Size Uploaded
git-word-blame-0.0.7.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for git-word-blame 0.0.7
File Interpreter ABI Platform
git_word_blame-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 26.6 kB

Release files / git-word-blame-0.0.7.tar.gz

Download URL git-word-blame-0.0.7.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8f5526f61348fe0f18249b9361600ab88922e9ae1e11f3a4af97fbe2645eceec
BLAKE2b-256 checksum
How to use checksums
63a4b12d10849773697cdc0ffc4b88f7fcb193dbcb6659c2fd4e0a2ac913b9b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 PyPy/6.0.0

Release files / git_word_blame-0.0.7-py3-none-any.whl

Download URL git_word_blame-0.0.7-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
593c0d2b7787d99f28104a7595fe2c9e7a8517f54ebed27342ec5a6f0b190154
BLAKE2b-256 checksum
How to use checksums
97d2da31d5258774312d4620ebb976611fda38757101a2a3c1492568b0c40b40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 PyPy/6.0.0

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page