Giter Site home page Giter Site logo

git-diff-blame's Introduction

git diff-blame

Annotates each line in a diff hunk with author and commit information like blame.

Example:

$ git diff-blame HEAD^
diff --git c/git-diff-blame w/git-diff-blame
--- c/git-diff-blame
+++ w/git-diff-blame
ed3dc1d5 (Desmond Brand 2014-01-09 12:08:57 -0800 52)           my $n_end = $n_ofs + $n_cnt - 1;
^275a5e3 (Desmond Brand 2014-01-09 12:04:26 -0800 53)           if (!$create) {
^275a5e3 (Desmond Brand 2014-01-09 12:04:26 -0800 54)               open($pre, '-|', 'git', 'blame', '-M', "-L$o_ofs,$o_end",
ed3dc1d5 (Desmond Brand 2014-01-09 12:08:57 -0800 55)   -                "-l",
^275a5e3 (Desmond Brand 2014-01-09 12:04:26 -0800 56)                    $oldrev, '--', $prefilename) or die;
^275a5e3 (Desmond Brand 2014-01-09 12:04:26 -0800 57)           }
^275a5e3 (Desmond Brand 2014-01-09 12:04:26 -0800 58)           if (!$delete) {
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 59)               if ($newrev) {
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 60)                   open($post, '-|', 'git', 'blame', '-M', "-L$n_ofs,$n_end",
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 61)   -                    "-l",
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 62)                        $newrev, '--', $postfilename) or die;
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 63)               } else {
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 64)                   open($post, '-|', 'git', 'blame', '-M', "-L$n_ofs,$n_end",
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 65)   -                    "-l",
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 66)                        '--', $postfilename) or die;
15f5a1f9 (Desmond Brand 2014-01-09 12:46:50 -0800 67)               }
^275a5e3 (Desmond Brand 2014-01-09 12:04:26 -0800 68)           }

Original version by @toddlipcon taken from here.

git-diff-blame's People

Contributors

blueyed avatar dmnd avatar sjbalaji avatar uu1101 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

git-diff-blame's Issues

Any idea if we could get the remove commit id for commit only remove the code?

Hi, Thanks for sharing this project!

for the result of the diff-blame, the commit only contains the code remove shows the commit the original commit of the removed ones, while for code history checking we always want to know who remove those code ( the remove commit for the commit).

any idea if we could get that in output? git blame in that case only gives the original commit, not the remove one, maybe need another commit to assist?

Single file

Is it possible to restrict the diff to a single file?

How to install?

The readme doesn't mention it and I think it would be useful for people less familiar with installing git extensions. I think you just need to put it somewhere on PATH, but not 100% sure.

Option to ignore whitespace

Add ability to pass -w (--ignore-whitespace) to diff.

Or really, the ability to pass any of git diff's args through to diff, and blame the result.

Errors when running

Hi, I'm getting some errors trying to run git diff-blame

Use of uninitialized value $prefilename in regexp compilation at /Users/ericfreese/bin/git-diff-blame line 54, <$diff> line 1.
Use of uninitialized value $postfilename in regexp compilation at /Users/ericfreese/bin/git-diff-blame line 57, <$diff> line 1.
Use of uninitialized value $prefilename in regexp compilation at /Users/ericfreese/bin/git-diff-blame line 54, <$diff> line 2.
Use of uninitialized value $postfilename in regexp compilation at /Users/ericfreese/bin/git-diff-blame line 57, <$diff> line 2.
Use of uninitialized value $prefilename in regexp compilation at /Users/ericfreese/bin/git-diff-blame line 54, <$diff> line 3.
Use of uninitialized value $postfilename in regexp compilation at /Users/ericfreese/bin/git-diff-blame line 57, <$diff> line 3.
Use of uninitialized value $prefilename in regexp compilation at /Users/ericfreese/bin/git-diff-blame line 54, <$diff> line 4.
Use of uninitialized value $postfilename in regexp compilation at /Users/ericfreese/bin/git-diff-blame line 57, <$diff> line 4.
Use of uninitialized value $prefilename in regexp compilation at /Users/ericfreese/bin/git-diff-blame line 54, <$diff> line 5.
Use of uninitialized value $postfilename in regexp compilation at /Users/ericfreese/bin/git-diff-blame line 57, <$diff> line 5.
Use of uninitialized value $prefilename in regexp compilation at /Users/ericfreese/bin/git-diff-blame line 54, <$diff> line 6.
Use of uninitialized value $postfilename in regexp compilation at /Users/ericfreese/bin/git-diff-blame line 57, <$diff> line 6.
Use of uninitialized value $pre in <HANDLE> at /Users/ericfreese/bin/git-diff-blame line 79.
readline() on unopened filehandle at /Users/ericfreese/bin/git-diff-blame line 79.
Use of uninitialized value $line in pattern match (m//) at /Users/ericfreese/bin/git-diff-blame line 21.
Use of uninitialized value $line in concatenation (.) or string at /Users/ericfreese/bin/git-diff-blame line 21.
bad blame output:  at /Users/ericfreese/bin/git-diff-blame line 21.

I'm on OSX with perl v5.18.2.

Any thoughts on what could be causing this? I haven't looked too deeply myself, but I haven't worked with perl in years...

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.