Code Monkey home page Code Monkey logo

git-blame's Introduction

git-blame

Toggle git-blame annotations in Atom.

Travis apm apm

screenshot

Usage

Use ctrl-b to activate blame. Alternatively, right click the file you want to blame and select Toggle Git Blame from the dropdown.

right-click-activate

See the revision diff

Click on the revision hash in the gutter to visit the configured repository diff site. Hosts supported out of the box are:

If the remote repo has a URL we don't recognize, or if there is no remote named origin, the commit hash will be copied to the clipboard. Custom remotes can be set globally via options. See below.

Options

Ignore White Space Diffs

If this option is selected, the git blame command will be run with -w option.

Show First Names

If this option is selected, only the first word of the author's name will be displayed. (If both Show First Names and Show Last Names are enabled, the entire author name will be displayed, regardless of whether it contains only two name parts).

Show Last Names

If this option is selected, only the last word of the author's name will be displayed. (If both Show First Names and Show Last Names are enabled, the entire author name will be displayed, regardless of whether it contains only two name parts).

Date Format String

Default date format is YYYY-MM-DD. This feature is backed by moment.js. Any formats supported by moment are valid here.

Color commit authors

If this option is selected, the commit authors will appear with a unique color to make them easily recognisable.

Custom Remote Repo Url

This plugin will first check to see if your repo is backed by GitHub, Bitbucket, or GitLab so nothing is required if your repo is hosted on one of these.

If its not, you can easily set a custom revision URL string like so:

  • From the settings view go to settings for this package Git Blame
  • Check the box for "Use Custom Url Template If Standard Remotes Fail"
  • Set your url format string in the box labeled Custom Commit Url String

url-settings

The URL string should contain the following three placeholder variables wrapped in underscore template delimiters like so: <%- variable %>.

  • project - Will be replaced with the name of the project in your remote git repository. For this repo it would be alexcorre.
  • repo - Will be replaced with the name of the repository. For this repo it would be git-blame.
  • revision - Will be replaced with the full git revision hash you clicked on.

I'll use github as an example. Its already supported out of the box, but if it wasn't its custom url string would be:

https://github.com/<%- project %>/<%- repo %>/commit/<%- revision %>

So when you clicked on hash revision 12345 in this git-blame repository, you would visit the following url:

https://github.com/alexcorre/git-blame/commit/12345

You can also set a custom URL in your git config. If present, it will be used insted of the one in the package settings. You can add or change it with this command:

git config --local atom-git-blame.repositoryUrlTemplate "http://my_server/gitweb/?p=<%- repo %>.git;a=commit;h=<%- revision %>"

Or by edit your .git/config and add an entry like this:

[atom-git-blame]
	repositoryUrlTemplate = "http://my_server/gitweb/?p=<%- repo %>.git;a=commit;h=<%- revision %>"

Release History

This project uses standard-version. Commit messages should use these conventions. fix, feat, and perf commits will show in the CHANGELOG.md generated upon release.

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.