bgb
is an interactive command-line program that's built on top of Git's blame
command and inspired by GitHub's blame view. It takes a file path tracked in a Git repository and produces an interactable view that annotates each line in the given file with information about the commit that last modified the line, with the ability to navigate the history of the file.
Download a binary that suits your OS/architecture from the Releases page of this repository and put the binary somewhere on your $PATH
.
Here's an example that installs bgb
version 0.0.2 for linux and amd64 architecture using wget
:
wget https://github.com/OsamaSayegh/bgb/releases/download/v0.0.2/bgb-linux-amd64
sudo cp bgb-linux-amd64 /usr/bin/bgb
After installing bgb
, call the program like this:
bgb <FILE>
where <FILE>
is substituted with the path of a file tracked in a Git repository. It's not necessary to cd
into the root directory of the repository; you can call bgb
from anywhere.
Keys | Function |
---|---|
j | scroll down 1 line |
k | scroll up 1 line |
shift+j | scroll down 10 lines |
shift+k | scroll up 10 lines |
g | go to the first line of the file |
shift+g | go to the last line of the file |
h | go back in the file history and see it before the commit that last modified the selected line |
l | go forward in the file history (undo what h does) |
/ | enable search mode to search within the file |
n | go to the next search result |
shift+n | go to the previous search result |
q | quit the program |
ctrl+c | quit the program |
- Clone this repository:
git clone https://github.com/OsamaSayegh/bgb.git
- Make your changes
- Run
make
to compile the program with your changes.make
writes the binaries to a_dist
directory - Test the compiled binaries
- Run
make format
to format the source files - Commit & push
(You need to have push access to this repository to complete these instructions)
- Make sure the
main
branch is checked out and there are no uncommitted changes (usegit status
) - Bump the
VERSION
variable at the top of theMakefile
- Follow the steps in the Development section above to commit the version bump change
- Run
make release
- On GitHub, go to the Releases page and create a new release for the new version and attach the binaries in the
_dist
directory with the release.