{"thread":{"id":"35898","subject":"Fwd: git-reviewed: linking commits to review discussion in git","startedAt":"2014-02-17T20:12:48Z","lastAt":"2014-03-10T23:43:33Z","messageCount":4,"participants":["Murtuza Mukadam","Jeff King","Thomas Rast","Peter C Rigby"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"234931","messageId":"CANx4bCAWVoCQdYQQ5cGXF-Z6Evck=Oeb2Shghkcuf7PMvSZBOA@mail.gmail.com","threadId":"35898","inReplyTo":"CANx4bCB5tTzKusbfcqQ=eoeOGJ-WxWvF3QNpfa5rTq7oOSG-5w@mail.gmail.com","subject":"Fwd: git-reviewed: linking commits to review discussion in git","fromName":"Murtuza Mukadam","fromEmail":"murtuza.i.mukadam@gmail.com","sentAt":"2014-02-17T20:12:48Z","receivedAt":"2014-02-17T20:12:48Z","isPatch":false,"sender":{"key":"murtuza.i.mukadam@gmail.com","avatar":null},"body":"Hello All,\n\nWe have linked peer review discussions on\ngit@vger.kernel.org to their respective commits within the main\ngit.git repository. You can view the linked reviews from 2012\nuntil present in the GitHub repo at:\nhttps://github.com/mmukadam/git/tree/review\n\nIf you want to search for the reviews related to a commit, you can\ntype in the full hash code here:\nhttp://users.encs.concordia.ca/~m_mukada/git-review-tracker.html\n\nor append the commit hash to the following url:\nhttps://github.com/mmukadam/git/tree/review/<commit_hash>\n\nNote, if you get a '404 page not found' from GitHub it means that we\ncouldn't find a review to link the commit to.\n\nIt's a bit hard to view the reviews on GitHub because the 'review' branch was\ndesigned to be viewed on the command line using a set of simple scripts that\nsit on top of the standard git commands.\n\nFor example:\nto view all reviews Hamano is involved in you can do:\ngit reviewed --log-reviewer hamano\n\nto view the reviews of particular commit:\ngit reviewed --log 1a1832eb085e5bca198735e5d0e766a3cb61b8fc\n\nYou can also create new reviews on a commit and mail them as well as\nimport reviews from email.\n\nNote the command is git-reivewED because git-review is associated with Gerrit.\n\nThe tool is beta, but it just creates a detached review branch, so it\nwon't affect master. To remove it all you do is delete the scripts and\nthe 'review' branch. More info available here:\n\nThe online man-page is here:\nhttp://users.encs.concordia.ca/~m_mukada/git-review.html\n\nIn order to install git-review, you need to clone the repository:\nhttps://github.com/mmukadam/git-reviewed.git\n\nThe online tutorial is available here:\nhttp://users.encs.concordia.ca/~m_mukada/git-review-tutorial.html\n\n\nSample output:\n\nLet's say you want to see the reviews related to commit:\n---------------------------------------------------------------------------------\ngit reviewed --log 9ce415d972a04df4bfceaad0fab8eaea9a66997e\n\nReview: 74d203accc341993dbed507fceceb2841670ce37\nCommit Reviewed: 9ce415d972a04df4bfceaad0fab8eaea9a66997e\nAuthor:     Johannes Sixt <j6t@kdbg.org>\nAuthorDate: Fri Jun 7 22:53:27 2013 +0200\nReviewer:   Junio C Hamano gitster@pobox.com <gitster@pobox.com>\nReviewDate: Thu Feb 13 11:35:13 2014 -0800\n\n\n    Re: [PATCH] tests: turn on network daemon tests by default\n\nReview: e80ebaa1fdd132a13bfbc6f87cdd4ecec7f2b715\nCommit Reviewed: 9ce415d972a04df4bfceaad0fab8eaea9a66997e\nAuthor:     Johannes Sixt <j6t@kdbg.org>\nAuthorDate: Fri Jun 7 22:53:27 2013 +0200\nReviewer:   Junio C Hamano gitster@pobox.com <gitster@pobox.com>\nReviewDate: Wed Feb 12 14:34:52 2014 -0800\n\n\n    Re: [PATCH] tests: turn on network daemon tests by default\n\nReview: 8da03766afcd60e432ffdd2d6f549e2ed02a4bc9\nCommit Reviewed: 9ce415d972a04df4bfceaad0fab8eaea9a66997e\nAuthor:     Johannes Sixt <j6t@kdbg.org>\nAuthorDate: Fri Jun 7 22:53:27 2013 +0200\nReviewer:   Jeff King peff@peff.net <peff@peff.net>\nReviewDate: Mon Feb 10 16:29:37 2014 -0500\n\n\n    [PATCH] tests: turn on network daemon tests by default\n\n\n\nTo show the email review discussion for a single review:\n---------------------------------------------------------------------------------\n\ngit reviewed --view 74d203accc341993dbed507fceceb2841670ce37\n\nCommit Reviewed: 9ce415d972a04df4bfceaad0fab8eaea9a66997e\nReviewer: Junio C Hamano <gitster@pobox.com>\nReviewer Date: Thu, 13 Feb 2014 11:35:13 -0800\n---------------------------------------------------------------\nFrom : Junio C Hamano <gitster@pobox.com>\nMessage-Id : <xmqqfvnmlsb2.fsf@gitster.dls.corp.google.com>\nDate : Thu, 13 Feb 2014 11:35:13 -0800\nSubject: Re: [PATCH] tests: turn on network daemon tests by default\nReferences: <20140210191521.GA3112@sigill.intra.peff.net>\n<20140210212931.GA16154@sigill.intra.peff.net>\n<xmqqa9dxpgw9.fsf@gitster.dls.corp.google.com>\n<20140211200445.GA27946@sigill.intra.peff.net>\n<xmqqzjlxnqvw.fsf@gitster.dls.corp.google.com>\n<20140212214753.GA6799@sigill.intra.peff.net>\n<xmqq38jom037.fsf@gitster.dls.corp.google.com>\nIn-Reply-To: <xmqq38jom037.fsf@gitster.dls.corp.google.com> (Junio C.\nHamano's message of \"Wed, 12 Feb 2014 14:34:52 -0800\")\nCc: Duy Nguyen <pclouds@gmail.com>, Git Mailing List\n<git@vger.kernel.org>, \"Shawn O. Pearce\" <spearce@spearce.org>\ncommit: 9ce415d972a04df4bfceaad0fab8eaea9a66997e\n\nJunio C Hamano <gitster@pobox.com> writes:\n\n> Jeff King <peff@peff.net> writes:\n>\n>>   test_normalize_tristate GIT_TEST_DAEMON\n>\n> Heh, great minds think alike.  This is what I am playing with,\n> without committing (because I do like your \"ask config if this is a\n> kind of various boolean 'false' representations, which I haven't\n> managed to add to it).\n\n[snip]\n\n---\n t/lib-git-daemon.sh     |  8 ++++---\n t/lib-httpd.sh          | 22 +++++++++----------\n t/test-lib-functions.sh | 58 +++++++++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 74 insertions(+), 14 deletions(-)\n\ndiff --git a/t/lib-git-daemon.sh b/t/lib-git-daemon.sh\nindex 394b06b..615bf5d 100644\n--- a/t/lib-git-daemon.sh\n+++ b/t/lib-git-daemon.sh\n@@ -16,9 +16,10 @@\n #      stop_git_daemon\n #      test_done\n\n-if test -z \"$GIT_TEST_GIT_DAEMON\"\n+test_tristate GIT_TEST_GIT_DAEMON\n+if test \"$GIT_TEST_GIT_DAEMON\" = false\n then\n-       skip_all=\"git-daemon testing disabled (define\nGIT_TEST_GIT_DAEMON to enable)\"\n+       skip_all=\"git-daemon testing disabled (unset\nGIT_TEST_GIT_DAEMON to enable)\"\n        test_done\n fi\n\n[snip]\n\n # The following mingw_* functions obey POSIX shell syntax, but are actually\n # bash scripts, and are meant to be used only with bash on Windows.\n\n--\n1.9.0-rc3-260-g4cf525c\n\n\nTo see all the reviews anyone is involved in:\n-------------------------------------------------------------------\n\ngit reviewed --log reviewer hamano\n\nReview: ecb6f98955700169ed6f88d929babd7d0f770116\nCommit Reviewed: 9c8ce7397bac108f83d77dfd96786edb28937511\nAuthor:     Michael J Gruber <git@drmicha.warpmail.net>\nAuthorDate: Thu Feb 13 11:35:08 2014 +0100\nReviewer:   Junio C Hamano gitster@pobox.com <gitster@pobox.com>\nReviewDate: Thu Feb 13 13:25:23 2014 -0800\n\n\n    Re: [PATCH] release notes: typo fixes\n\nReview: 74d203accc341993dbed507fceceb2841670ce37\nCommit Reviewed: 9ce415d972a04df4bfceaad0fab8eaea9a66997e\nAuthor:     Johannes Sixt <j6t@kdbg.org>\nAuthorDate: Fri Jun 7 22:53:27 2013 +0200\nReviewer:   Junio C Hamano gitster@pobox.com <gitster@pobox.com>\nReviewDate: Thu Feb 13 11:35:13 2014 -0800\n\n\n    Re: [PATCH] tests: turn on network daemon tests by default\n\nReview: e80ebaa1fdd132a13bfbc6f87cdd4ecec7f2b715\nCommit Reviewed: 9ce415d972a04df4bfceaad0fab8eaea9a66997e\nAuthor:     Johannes Sixt <j6t@kdbg.org>\nAuthorDate: Fri Jun 7 22:53:27 2013 +0200\nReviewer:   Junio C Hamano gitster@pobox.com <gitster@pobox.com>\nReviewDate: Wed Feb 12 14:34:52 2014 -0800\n\n\n    Re: [PATCH] tests: turn on network daemon tests by default\n\n\n\nPlease let us know what you think about this tool as it will help us\nin improving it. If you'd like us to extract the reviews related to a\ndifferent repository, please let us know.\n\nThis is part of my Msc thesis, so any feedback is appreciated.\nWe thank you for you time.\n\nCheers,\nMurtuza\n"},{"id":"234939","messageId":"20140218052827.GA25291@sigill.intra.peff.net","threadId":"35898","inReplyTo":"CANx4bCAWVoCQdYQQ5cGXF-Z6Evck=Oeb2Shghkcuf7PMvSZBOA@mail.gmail.com","subject":"Re: Fwd: git-reviewed: linking commits to review discussion in git","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-02-18T05:28:27Z","receivedAt":"2014-02-18T05:28:27Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Feb 17, 2014 at 03:12:48PM -0500, Murtuza Mukadam wrote:\n\n> We have linked peer review discussions on\n> git@vger.kernel.org to their respective commits within the main\n> git.git repository. You can view the linked reviews from 2012\n> until present in the GitHub repo at:\n> https://github.com/mmukadam/git/tree/review\n\nNeat. We've experimented in the past with mapping commits back to\nmailing list discussions.  Thomas (cc'd) has a script that creates\ngit-notes trees mapping commits to the relevant message-id, which can\nthen be found in the list archive.\n\nTo me, the interesting bits of such a project are:\n\n  1. How do we decide which messages led to which commits? There is\n     definitely some room for heuristics here, as patches are sometimes\n     tweaked in transit, or come in multiple stages (e.g., the original\n     patch, then somebody suggests a fixup on top). You might want to\n     compare your work with the script from Thomas here:\n\n       http://repo.or.cz/w/trackgit.git\n\n  2. How do we store the mapping? I think git-notes are a natural fit\n     here, but you don't seem to use them. Is there a reason?\n\n  3. How do we present the emails to the user (including showing\n     threads, letting them dig deeper, etc)?\n\n     The existing solution has no support at all for 3. Personally, I\n     keep my own git-list archive locally, so I can search it (by\n     message-id or other features), dump the result into an mbox\n     (optionally including the surrounding thread), and then view the\n     result in mutt.\n\nHaving had this solution for a while, my experience has been that I\ndon't use it that often. It's not that I don't refer to the archive to\nsee more backstory on a commit; I probably do that once a week or so.\nBut since I have a decent searchable archive, I tend to just do it \"by\nhand\", searching for keywords from the commit message, and limiting by\ndate if necessary.\n\nGoing straight to the message by id might be a little faster, but I\noften pick up stray bits in my search that were not part of the original\nthread. E.g., somebody reports a bug, then 3 days later, somebody else\nposts a patch (but does not do it as a reply to the bug). There's\nnothing in the message headers or the commit mapping to say that those\ntwo messages are related. But because a search of the relevant terms\nfinds both, and because the result is date-sorted, they end up near each\nother and it's easy for me to peruse.\n\nIt would be interesting to apply some kind of clustering algorithm that\nautomatically determines the messages related to a commit, including\nboth the patch but also any discussion leading up to it. I realize that\nmay be getting far afield of your original goals, but hey, you said you\nwanted feedback. I can reach for the stars. :)\n\n-Peff\n"},{"id":"235193","messageId":"871tyvrt51.fsf@thomasrast.ch","threadId":"35898","inReplyTo":"20140218052827.GA25291@sigill.intra.peff.net","subject":"Re: Fwd: git-reviewed: linking commits to review discussion in git","fromName":"Thomas Rast","fromEmail":"tr@thomasrast.ch","sentAt":"2014-02-22T16:47:54Z","receivedAt":"2014-02-22T16:47:54Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Mon, Feb 17, 2014 at 03:12:48PM -0500, Murtuza Mukadam wrote:\n>\n>> We have linked peer review discussions on\n>> git@vger.kernel.org to their respective commits within the main\n>> git.git repository. You can view the linked reviews from 2012\n>> until present in the GitHub repo at:\n>> https://github.com/mmukadam/git/tree/review\n>\n> Neat. We've experimented in the past with mapping commits back to\n> mailing list discussions.  Thomas (cc'd) has a script that creates\n> git-notes trees mapping commits to the relevant message-id, which can\n> then be found in the list archive.\n>\n> To me, the interesting bits of such a project are:\n>\n>   1. How do we decide which messages led to which commits? There is\n>      definitely some room for heuristics here, as patches are sometimes\n>      tweaked in transit, or come in multiple stages (e.g., the original\n>      patch, then somebody suggests a fixup on top). You might want to\n>      compare your work with the script from Thomas here:\n>\n>        http://repo.or.cz/w/trackgit.git\n\nEh, or don't.  My script nowadays uses Junio's suggestion of matching on\n(author, authordate) with a little bit of tweaking in case there is no\nmatch.  The name/date match works for most cases even in slightly\ntweaked forms.\n\n(The very first version elaborately tried all sorts of things, including\nattempting to patch on master, next etc. to see where it applies, and\nturned out to be waaaay too slow.)\n\nI'm no longer convinced that there's anything a computer can do beyond\n(author, authordate), anyway.  Perhaps someone with a clue in UIs --\nthat's definitely not me -- could make a website where users can\ncomplete or correct the autogenerated mappings to go further.\n\n-- \nThomas Rast\ntr@thomasrast.ch\n"},{"id":"236470","messageId":"CAN6Z0OqLqmyjFKfzhBrPxzeGMZ+aE4UcuM9Upqzn9Cr3CyXNSw@mail.gmail.com","threadId":"35898","inReplyTo":"8635c4b807ab40db93da43875645dfc8@UMS-SGWHTS1.concordia.ca","subject":"Re: Fwd: git-reviewed: linking commits to review discussion in git","fromName":"Peter C Rigby","fromEmail":"peter.rigby@concordia.ca","sentAt":"2014-03-10T23:43:33Z","receivedAt":"2014-03-10T23:43:33Z","isPatch":false,"sender":{"key":"peter.rigby@concordia.ca","avatar":null},"body":"On Tue, Feb 18, 2014 at 12:28 AM, Jeff King <peff@peff.net> wrote:\n[snip]\n>\n>   3. How do we present the emails to the user (including showing\n>      threads, letting them dig deeper, etc)?\n\nWe created a website, you enter a commit and it shows you the reviews:\nhttp://cesel.encs.concordia.ca/process_request.php?repo=git\n\nThe site will either display the message id for the review or redirect\nyou the mailing list archive.\n\n\nOn Sat, Feb 22, 2014 at 11:47 AM, Thomas Rast <tr@thomasrast.ch> wrote:\n> Jeff King <peff@peff.net> writes:\n>\n>> On Mon, Feb 17, 2014 at 03:12:48PM -0500, Murtuza Mukadam wrote:\n\nVery sorry for the delayed response. We wanted compare our linking\ntechnique with yours, see below.\n\n>>\n>>> We have linked peer review discussions on\n>>> git@vger.kernel.org to their respective commits within the main\n>>> git.git repository. You can view the linked reviews from 2012\n>>> until present in the GitHub repo at:\n>>> https://github.com/mmukadam/git/tree/review\n>>\n>> Neat. We've experimented in the past with mapping commits back to\n>> mailing list discussions.  Thomas (cc'd) has a script that creates\n>> git-notes trees mapping commits to the relevant message-id, which can\n>> then be found in the list archive.\n>>\n>> To me, the interesting bits of such a project are:\n>>\n>>   1. How do we decide which messages led to which commits? There is\n>>      definitely some room for heuristics here, as patches are sometimes\n>>      tweaked in transit, or come in multiple stages (e.g., the original\n>>      patch, then somebody suggests a fixup on top). You might want to\n>>      compare your work with the script from Thomas here:\n>>\n>>        http://repo.or.cz/w/trackgit.git\n>\n> Eh, or don't.  My script nowadays uses Junio's suggestion of matching on\n> (author, authordate) with a little bit of tweaking in case there is no\n> match.  The name/date match works for most cases even in slightly\n> tweaked forms.\n\nIn our technique, we take each email patch, eliminate white space and\nhash each line. We then compare the lines with those in commits to the\nsame files. The commit that changes the same files and has the largest\nnumber of matching lines is considered to be the reviewed commit.\n\nWe compared Junio's (author, authordate) and our technique on a\nmanually created benchmark of 30 messages from the linux, postgres,\nand git mailing lists. We found that Junio's simple technique\nperformed equally well to our more complicated technique (see results\nat end of email).\n\nOn Tue, Feb 18, 2014 at 12:28 AM, Jeff King <peff@peff.net> wrote:\n>   2. How do we store the mapping? I think git-notes are a natural fit\n>      here, but you don't seem to use them. Is there a reason?\n\nWe wanted a way to store each review as its own blob, so we put the\nreviews on a detached 'review' branch and then wrote some simple\nscripts to access and display these reviews on the command line (\\eg\ngit reviewed --show <commit_hash>).\n\nHowever, given the previous discussion on this list\n(http://git.661346.n2.nabble.com/RFC-RFH-Fun-things-with-git-notes-or-patch-tracking-backwards-td2297330.html),\nwe agree that just putting the msg_id as a note is probably more\nuseful. One additional problem we ran into when storing all the\nreviews, is for something like Linux, the reviews took up a massive\namount of storage.\n\n> It would be interesting to apply some kind of clustering algorithm that\n> automatically determines the messages related to a commit, including\n> both the patch but also any discussion leading up to it. I realize that\n> may be getting far afield of your original goals, but hey, you said you\n> wanted feedback. I can reach for the stars. :)\n\nIt would be interesting to be able to tie in other discussion, perhaps\nrelated bugs. A future project.\n\nThanks,\nPeter\n\nEvaluation of linking commits with email reviews on 30 messages from\nLinux, postgres, and git mailing lists\n\nLinux - Files and lines changed:\n\nPerfect: 87%\nNo Match: 13%\nIncorrect: 0%\n\nLinux - Thomas/Junio  (author, authordate)\n\nPerfect: 87%\nNo Match: 13%\nIncorrect: 0%\n\nGit - Files and lines changed:\n\nPerfect: 74 %\nNo Match  23  %\nIncorrect: 3 %\n\nGit - Thomas/Junio  (author, authordate)\n\nPerfect: 77%\nNo Match: 23%\nIncorrect: 0%\n\nPostgres - Files and lines changed:\n\nPerfect: 57 %\nNo Match  36  %\nIncorrect: 7 %\n\nPostgres - Thomas/Junio  (author, authordate)\n\nPerfect: 50%\nNo Match: 37%\nIncorrect: 13%\n\n-- \nhttp://users.encs.concordia.ca/~pcr/\n"}]}