Skip to main content

bblame is an interactive ncurses git blame viewer. Allowing you to explore the git history of a file.

Features

  • Browse forwards and backwards through file history a commit at a time

  • Select a line and drill into the history past the commit that changed that line most recently

  • Full code syntax highlighting support

  • Display the git show for the commit of any selected line

  • Browse file history across file renames

Usage

bblame is a curses application. Usage will be displayed when called with no arguments or -h --help:

usage: __main__.py [-h] [--revision {revision}] [--debug] [--version]
                                   filename [+{line_num} or +/{search_pattern}]

positional arguments:
  filename              Name or path to file to blame
  +{line_num} or +/{search_pattern}
                                                The line number or search pattern the cursor will be positioned on (this arg will put bblame in visual mode)

optional arguments:
  -h, --help            show this help message and exit
  --revision {revision}, -r {revision}
                                                The revision to initialize the blame file to
  --debug               Increase logging and show tracebacks
  --version             show program's version number and exit

To show available commands while running bblame use the h key, which will display the key to action bindings, example below:

KEYS: ACTION - DESCRIPTION
--------------------------
 q:   Quit
    Quit the application

 /:   Search
    Search downward through the current blame or commit

 n:   Next Search Match
    Jump to the next search match (in the downward direction)

 N:   Prev Search Match
    Jump to the prev search match (in the upward direction)

 v:   Visual Select Mode
    Enter visual select mode (only from normal mode)

 o:   Show/View Commit
    Show a commit selected by the visual mode cursor

 O:   Show/View file Commit
    Show the current revision commit

 ESC:   Normal Mode
    Return to Normal mode

 ENTER, d:   Drill Down
    Drill down past the commit highlighted in visual mode. Opens a new git blame

 <, ,:   Parent blame
    Move to git blame of the parent of current commit
    (i.e. traverse backwards through history, one commit at a time)

 >, .:   Ancestor blame
    Move to git blame of the ancestor of current commit
    (i.e. traverse forwards through history, one commit at a time)

 BACKSPACE, DC, f:   Pop Back
    Pop back to previous git object

 g, HOME:   Jump to Top
    Jump to the top of the screen

 G, END:   Jump to Bottom
    Jump to the bottom of the screen

 h:   Help
    Display the help message

 s:   Toggle Syntax Highlight
    Toggle syntax highlighting on or off. Showing or hiding syntax
    highlighting ONLY IF IT IS ENABLED.

 H:   Jump to HEAD
    Jump to a blame of the most recent commit for the file

 T:   Jump to TAIL
    Jump to a blame of the first commit for the file

Installation

sudo -H pip install bblame

or

python setup.py install

Issue

Issue tracker can be found here

Plugins:

You’ll find a plugins dir if you clone the git repo (or browse to it on bitbucket) I’m a vim guy, so that means so far there is only a vim plugin ;) Though, I encourage pull requests or links to repos containing plugins for other editors/software!

Development:

Pull requests welcome

Git repo can be found here

Dependencies you’ll need to install with your package manager for dev and test:

  • pip/pip3 (bblame supports both 2.7.X and 3+ versions of python)

  • tmux (a dependency of the curses unit test library, hecate)

  • make

The rest of the dependencies can be installed with:

  • make py_env

Useful Dev Notes:

  • run make check to execute static analysis and unittests

  • run python -m betterblame <args> in root of betterblame.git to run an instance of bblame with your changes

  • You can use the test files in tests/testfiles/ for manual testing.

Metadata

Release files for bblame 0.7.0

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

Source distribution (sdist)

Source distribution for bblame 0.7.0
File Size Uploaded
bblame-0.7.0.tar.gz 35.4 kB Details

Release files / bblame-0.7.0.tar.gz

Download URL bblame-0.7.0.tar.gz
Size 35.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cbfaa9e93aaca9348f8fc4764b882ba86a67dd0c5bc3a763f8783be04ba60a10
BLAKE2b-256 checksum
How to use checksums
b47f47843eed67c38441fb7fc5ba4c8fb2a24af3d5bc7a06267590a8c5ed5e31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.7.0 This release

1 release file

0.6.4

1 release file

0.6.3

1 release file

0.5.9

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.3.5

1 release file

0.3.4

1 release file

0.3.3

1 release file

0.1.5

1 release file

0.1.4

1 release file

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