git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: A generalization of git blame

From
Philip Oakley <philipoakley@iee.org>
Date
Sep 25, 2012, 22:19 UTC
Message-ID
<CC2642CD25C542A18FB55E7BD58F95E5@PhilipOakley>
In-Reply-To
<89ccf5dd776edc648d488c20214e1105.squirrel@webmail.cs.wisc.edu>
From: <xmeng@cs.wisc.edu>
Show 20 quoted lines
> I have been developing my git tool (based on the git internal API) 
> that
> can find out all the commits that have changed a line for better
> authorship.
>
> The reason is for my binary code authorship research, I use machine
> learning to classify code authorship. To produce training data, I 
> start
> with a source code repository with well-known author labels for each 
> line
> and then compiling the project into binary. So, I am able to know the
> authorship for binary code and then apply some machine learning
> techniques.
>
> To get ground truth of authorship for each line, I start with 
> git-blame.
> But later I find this is not sufficient because the last commit may 
> only
> add comments or may only change a small part of the line, so that I
> shouldn't attribute the line of code to the last author.
I would suggest there is:
- White space adjustment
- Comment or documentation (assumes you can parse the 'code' to decide 
that it isn't executable code)
- word changes within expressions
- complete replacement of line (whole statement?)
Custom & practice is the likely decider.
Show 12 quoted lines
>                              Of course, there
> must be some debates on who can be the representative of a line of 
> code.
> So what I would like to do is find out all the commits that have ever
> changed a line, then I can try different approaches to summarize over 
> all
> these commits to produce my final authorship label (or even tuple).
>
> I was wondering whether there have been similar debates over accurate
> authorship in this community before and whether there may be other 
> people
> interested in this work.

I'd suggest looking at the various 'diff' formats, such as character diff, word diff, and line diff for discussions.

Show 5 quoted lines
>
> Thanks
>
> --Xiaozhu
>
Philip 
Previous: xmeng@cs.wisc.eduNext: Junio C Hamano
Message 2 of 7 in “A generalization of git blame”
  1. xmeng@cs.wisc.eduSep 25, 2012
  2. Philip OakleySep 25, 2012
  3. Junio C HamanoSep 25, 2012
  4. xmeng@cs.wisc.eduSep 26, 2012
  5. Junio C HamanoSep 26, 2012
  6. xmeng@cs.wisc.eduSep 27, 2012
  7. Junio C HamanoSep 27, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.