git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* A new idea to extend git-blame
@ 2019-11-25 12:41 Chen Bin
  2019-11-25 14:16 ` Jeff King
  0 siblings, 1 reply; 8+ messages in thread
From: Chen Bin @ 2019-11-25 12:41 UTC (permalink / raw)
  To: git

I already implemented the idea in Emacs Lisp. See,

http://blog.binchen.org/posts/effective-git-blame-in-emacs.html

I tested at https://github.com/redguardtoo/test-git-blame

Looks it works.

The only issue is Lisp is slow in big code base.

So I'm thinking I could re-implement it in C instead.

My question is, *who can I contact to understand git-blame?

I'm experienced at C but need some expert's guide.

The key algorithm is simple,

The algorithm only works for one line blame and the user must
select text inside the line first.

Step 1, `git blame -L6,1 --porcelain -- hello.js` output,

    4f87408612e0dacfd89a1cd2515944e21cf68561 6 6 1
    skip...
    filename hello.js
     doit({bad: 'destroy world', good: 'hello world', ...});

I got the commit id (1st column), the line number (2nd column),
file name (hello.js) and the code line (last line).

Step 2, if the code line does not contain the selected text, the
  recursive search stops

Step 3, or else use commit id, line number and file name to build
  new git blame cli, like,

`git blame -L line-num,1 --porcelain 4f8740^ file-name`

Step 4, execute new git blame command and start from Step 1

Here is my first commit (added some debug code),

https://github.com/redguardtoo/git/commit/d01d26f2df

-- 
Best Regards,
Chen Bin

--
Help me, help you

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-11-27 13:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25 12:41 A new idea to extend git-blame Chen Bin
2019-11-25 14:16 ` Jeff King
2019-11-26  4:55   ` chen bin
2019-11-26  5:36     ` chen bin
2019-11-27  7:32       ` chen bin
2019-11-27 11:30         ` Jeff King
2019-11-27 12:18           ` chen bin
2019-11-27 13:38           ` chen bin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).