{"id":13813728,"url":"https://github.com/johnnadratowski/git-reviewers","last_synced_at":"2025-10-30T06:32:20.594Z","repository":{"id":136669864,"uuid":"77067947","full_name":"johnnadratowski/git-reviewers","owner":"johnnadratowski","description":null,"archived":false,"fork":false,"pushed_at":"2019-03-08T19:59:44.000Z","size":135,"stargazers_count":62,"open_issues_count":1,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-23T00:03:51.062Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnnadratowski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-12-21T16:27:51.000Z","updated_at":"2024-06-28T03:56:06.000Z","dependencies_parsed_at":"2024-01-20T15:52:46.300Z","dependency_job_id":"b420efe3-d742-47d9-8a39-9c8a38d87da5","html_url":"https://github.com/johnnadratowski/git-reviewers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/johnnadratowski/git-reviewers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnadratowski%2Fgit-reviewers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnadratowski%2Fgit-reviewers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnadratowski%2Fgit-reviewers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnadratowski%2Fgit-reviewers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnnadratowski","download_url":"https://codeload.github.com/johnnadratowski/git-reviewers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnadratowski%2Fgit-reviewers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005941,"owners_count":26083999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T04:01:27.539Z","updated_at":"2025-10-11T02:36:24.639Z","avatar_url":"https://github.com/johnnadratowski.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# git-reviewers\n\n**Tested with python 2.7.12 and 3.5.2 but probably will work with \u003e=2.5**\n\n**Tested with git version 2.11.0**\n\nWouldn't it be nice if git could give you this output when you have a large PR working with a big team?\n\n![Suggested Reviewers](./doc/img/suggested-reviewers.png)\n\nWhen working on a large team or in a large company, sometimes its difficult to\ntell who you should add as a reviewer to a pull request... especially when\nyour PR spans multiple files/modules.  Everyone can’t be monitoring for new\nPRs all the time, especially across many codebases.\n\nThe theory behind this is that if you’re changing a line of code in the vicinity\nof what someone has touched, maybe they should be notified of the PR for review.\nIt accomplishes this by using the `git blame` of the lines around the diff of\na branch.\n\n## Installation\n\nYou can easily install the utility by running the following command:\n\n    pip install git+https://github.com/johnnadratowski/git-reviewers.git\n\n## Usage\n\n```\n# This will tell you the potential reviewers of the branch, ordered by most prolific, against master\ngit reviewers -b master\n\n# If you omit -b, it will default first to a `develop` (a la git flow) branch, \n# then to `master` if no `develop` branch exists\ngit reviewers\n\n# If you only want to see suggested reviewers for certain files:\ngit reviewers app/test/testfoo.py app/test/testbar.py\n\n# If you want to use this to pipe to another command, \n# you can dump out the raw in-memory data structures as JSON\ngit reviewers --output=raw\n\n# Specifying a contributer will drop into a ‘diff’ mode, showing you the lines of\n# code the contributer has touched in/near your changes\n# NOTE: if Pygments is installed, it gives nice syntax highlighting\ngit reviewers -c “Sally” app/test/testfoo.py app/test/testbar.py\n```\n\n## How does it work?\n\nThe implementation is really simple, actually.  First, it gets all of the files changed using `git diff --stat`.  Then it will get all of the lines around your changes using `git diff` for each file.  It then splits up the chunks of those ranges to feed to `git blame -L {line numbers}` to get the people who\nare familiar with the code.\n\nThere are definitely opportunities to improve. Right now it simply counts up the lines, determines the contribution % of each contributer, sorts them, and outputs the information.  However it could be much smarter, and look at what the line of code is doing, or have some weighted value for each type of line depending on what happened in the file.\n\nAlso, if you only added files, it has nothing to compare.  In that case it probably makes sense to look at the other files in the module or something else, like the modules that import the new file.\n\n`git-reviewers` gets installed somewhere on `$PATH` so that git can understand `reviewers` as a subcommand.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnadratowski%2Fgit-reviewers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnnadratowski%2Fgit-reviewers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnadratowski%2Fgit-reviewers/lists"}