[PATCH] D46192: Script to match open Phabricator reviews with potential reviewers

Kristof Beyls via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 1 06:46:20 PDT 2018


kristof.beyls added a comment.

In https://reviews.llvm.org/D46192#1082638, @JDevlieghere wrote:

> In https://reviews.llvm.org/D46192#1082049, @lebedev.ri wrote:
>
> > This should probably go into `llvm/utils`, not the root.
> >
> > It would also be good to have the opposite script - "given `git diff` / commits, whom should i add as reviewers?"
>
>
> I once wrote the following one-liner to do this. It works pretty well but it can be *very* slow. It will suggest a top 10 of reviewers for your staged changes.
>
> `git diff --name-only --cached | xargs -n 1 git blame --porcelain | grep  \"^author \" | sort | uniq -c | sort -nr | head -10`
>
> > It could evaluate `CODE_OWNERS.txt`, `git log` / `git shortlog -sne` of the changed files, `git blame`.


Thanks for sharing, Jonas!

Your one-liner could become the start of a new "suggest_reviewers" script?


https://reviews.llvm.org/D46192





More information about the llvm-commits mailing list