Created
February 20, 2015 13:17
-
-
Save bankair/6f501c27d3020c909e56 to your computer and use it in GitHub Desktop.
Display the commit that last modified a specific line of a file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/ruby | |
| file, line = (ARGV.shift || raise('Missing loc. Ex: /path/to/file:line')).split(/:/) | |
| exec "git show $(git blame #{file} -L #{line},#{line} | awk '{print $1}')" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment