GithubHelp home page GithubHelp logo

bgb's Introduction

bgb

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.

Installation

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

Usage

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.

Interactive Commands

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

Development

  1. Clone this repository:
git clone https://github.com/OsamaSayegh/bgb.git
  1. Make your changes
  2. Run make to compile the program with your changes. make writes the binaries to a _dist directory
  3. Test the compiled binaries
  4. Run make format to format the source files
  5. Commit & push

Cutting a New Release

(You need to have push access to this repository to complete these instructions)

  1. Make sure the main branch is checked out and there are no uncommitted changes (use git status)
  2. Bump the VERSION variable at the top of the Makefile
  3. Follow the steps in the Development section above to commit the version bump change
  4. Run make release
  5. 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.

bgb's People

Contributors

osamasayegh avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.