From: xmeng <xmeng@cs.wisc.edu>
To: git@vger.kernel.org
Subject: Check out git-author
Date: Sun, 07 Sep 2014 18:05:13 -0500 [thread overview]
Message-ID: <0a3b0f232ec56517d4db43c6bd6ebb63@cs.wisc.edu> (raw)
Hi all,
I have been using git-blame to track who changed a line of code or who
to blame for a line of code. It is easy to use. For example, for this
particular line of code:
$ git blame -L 2235,2235 fs/ext4/mballoc.c
85556c9a (Wei Yongjun 2012-09-26 20:43:37 -0400 2235)
meta_group_info[i] = kmem_cache_zalloc(cachep, GFP_KERNEL);
The problem with git-blame is that it only reports the last
author/commit that changed the line, regardless of the magnitude of the
change. Sometimes, the last author may only change a tiny part of the
code and should not be blamed. I developed a built-in tool called
"git-author" to address this problem. Git-author is designed to track
the complete development history of a line. For the same line of code:
$ git author -c -L 2235,2235 fs/ext4/mballoc.c
CURRENT LINE 2235: meta_group_info[i] =
kmem_cache_zalloc(cachep, GFP_KERNEL);
85556c9 Wei Yongjun : meta_group_info[i] =
kmem_cache_zalloc(cachep, GFP_KERNEL);
fb1813f Curt Wohlgemuth : meta_group_info[i] =
kmem_cache_alloc(cachep, GFP_KERNEL);
5f21b0e Frederic Bohe : meta_group_info[i] = kzalloc(len,
GFP_KERNEL);
c9de560 Alex Tomas : meta_group_info[j] =
kzalloc(len, GFP_KERNEL);
Git-author shows the complete development history of this line code. We
can see "Wei Yongjun" only changed the line to call a different function
(from "kmem_cache_alloc" to "kmem_cache_zalloc"). "Wei yongjun" is not
responsible for the other part of the line. "Curt Wohlgemuth" changed
the line to call a different function (from "kzalloc" to
"kmem_cache_alloc") and to use a different parameter (from "len" to
"cachep") and "Frederic Bohe" changed the line to use a different array
index (from "i" to "j").
Git-author should be useful to people who wants to see the complete
history of lines of code.
If you are interested in git-author, you can check it out at
https://github.com/mxz297/git/tree/git-author (please check out branch
'git-author'). Also we have a paper describing more technical details
about git-author in ICSM 2013
(ftp://ftp.cs.wisc.edu/paradyn/papers/Meng13Authorship.pdf).
Let me know if you have any question, feedback, bug about git-author!
Thanks
--Xiaozhu
next reply other threads:[~2014-09-07 23:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-07 23:05 xmeng [this message]
2014-09-08 5:19 ` Check out git-author Jeff King
2014-09-08 7:16 ` Torsten Bögershausen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0a3b0f232ec56517d4db43c6bd6ebb63@cs.wisc.edu \
--to=xmeng@cs.wisc.edu \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).