{"id":20438186,"url":"https://github.com/kiprasmel/git-historical-blame","last_synced_at":"2026-05-15T23:06:48.524Z","repository":{"id":97544374,"uuid":"481415896","full_name":"kiprasmel/git-historical-blame","owner":"kiprasmel","description":"big PR in multi-team repo? unclear who to ask for review? you're in luck.","archived":false,"fork":false,"pushed_at":"2022-11-15T06:29:34.000Z","size":112,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T07:22:29.957Z","etag":null,"topics":["blame","git","git-blame","git-log","historical"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kiprasmel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-14T00:33:52.000Z","updated_at":"2024-03-11T01:35:54.000Z","dependencies_parsed_at":"2023-03-13T16:11:23.575Z","dependency_job_id":null,"html_url":"https://github.com/kiprasmel/git-historical-blame","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kiprasmel/git-historical-blame","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiprasmel%2Fgit-historical-blame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiprasmel%2Fgit-historical-blame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiprasmel%2Fgit-historical-blame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiprasmel%2Fgit-historical-blame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiprasmel","download_url":"https://codeload.github.com/kiprasmel/git-historical-blame/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiprasmel%2Fgit-historical-blame/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33082827,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:25:35.270Z","status":"ssl_error","status_checked_at":"2026-05-15T20:25:34.732Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["blame","git","git-blame","git-log","historical"],"created_at":"2024-11-15T09:09:43.490Z","updated_at":"2026-05-15T23:06:48.493Z","avatar_url":"https://github.com/kiprasmel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-historical-blame\n\noriginal problem:\nhave a big PR in a huge, multi-team repo. unclear who to ask for review.\n\nsolution:\nfind which devs have worked with the files that we modified in the PR,\naggregate by their teams, and kindly ask for reviews.\n\n## current implementation \u0026 it's flaws \n\nfor every single file that has been modified since `\u003ccommittish\u003e`,\nwill go thru the full history of the file (commits),\nwill collect info (additions, deletions, author), \nwill aggregate them and, if extra info is provided,\nwill provide people-based and team-based statistics\nof the ownership of the files.\n\nthe heuristics could be improved a ton --\ncurrently there's a lot of overlapping ownership since every commit etc.,\nbut for starters, this will do.\n\n## dependencies\n\n- git\n- node.js, tested with v12\n\t- yarn\n\n## setup\n\n```sh\ngit clone https://github.com/kiprasmel/git-historical-blame.git\n# or:    git clone git@github.com:kiprasmel/git-historical-blame.git\n\ncd git-historical-blame/\n\nyarn\n```\n\n## usage\n\n```sh\n# pre-process the git history.\n# note - matters in which committish the repo is checked out\n./git-historical-blame.ts \u003c../path/to/repo\u003e \\\n                          \u003ccommittish-of-file-modification-begin=origin/master\u003e \\\n                          \"\" \\\n                          \u003cfiles,to,ignore\u003e\n\n# re-group from file-by-file to author-by-author\n./group.ts\n```\n\nbasics done, some .json{.csv} files will be generated.\nnow, to enhance the data with team members,\nprovide a json file with an array of teammate objects:\n\n```json\n[\n  {\n    \"fullname\": \"Kipras Melnikovas\",\n    \"email\": \"kipras@kipras.org\",\n    \"team\": \"Sigma\"\n  }\n]\n```\n\nsidenote: see below [1] for quick scripts to transform your data \nif you have it in a different format \u0026/ multiple files.\n\nnote: obviously, best results will be achieved\nif the teammates' emails \u0026 names match\nwith those they provided in their ~/.gitconfig.\nsee `findMatchingTeam` in teamify.ts.\ncurrently, there's no logic for duplicate merging,\nor even more advanced things like Levenshtein/edit distance\nto compare the names/email addresses, but those can be added\nin the future / by yourself.\n\nonce ready, use the data like so (depends on previous scripts above):\n\n```sh\n./teamify \u003c../path/to/teams.json\u003e\n```\n\nthis will produce multiple files:\n- teamified.json{.csv} - same as grouped.json above, but adds the team to a person when it matches\n- by-team.json{.csv} - same as previous, but also grouped by the team\n- team-stats.json{.csv} - aggregate statistics per team.\n\nthe 2 (3) most interesting files will be `team-stats.csv`,\nand `by-team.json.csv` (`by-team.json` for exact details).\n\n### [1] example of quick scripts for combining the data from multiple files \u0026 transforming into wanted form:\n\ncombine.js:\n\n```js\n#!/usr/bin/env node\n\nconst fs = require(\"fs\")\n\nfunction combine({\n\tfilepaths,\n\tcombined,\n}) {\n\tlet jsons = []\n\tfor (const f of filepaths) {\n\t\tconst json = JSON.parse(fs.readFileSync(f, { encoding: \"utf-8\" }))\n\t\tjsons.push(json)\n\t}\n\n\tjsons = jsons.flat()\n\tfs.writeFileSync(combined, JSON.stringify(jsons, null, 2), { encoding: \"utf-8\" })\n}\n\nif (!module.parent) {\n\tprocess.argv.splice(0, 2)\n\tconst filepaths = (process.argv[0] || \"\").split(\",\")\n\tconst combined = (process.argv[1] || \"combined.json\")\n\n\tcombine({\n\t\tfilepaths,\n\t\tcombined\n\t})\n}\n```\n\nteamify-prep.js:\n\n```js\n#!/usr/bin/env node\n\nconst fs = require(\"fs\")\n\nfunction teamifyPrep() {\n\tconst json = JSON.parse(fs.readFileSync(\"combined.json\", { encoding: \"utf-8\" }))\n\n\tconst newJson = json.map(t =\u003e ({\n\t\t\tfullname: t.full_name,\n\t\t\temail: t.email,\n\t\t\tteam: t.tribe_name,\n\t\t})\n\t)\n\n\tfs.writeFileSync(\"teams.json\", JSON.stringify(newJson, null, 2), { encoding: \"utf-8\" })\n}\n\nif (!module.parent) {\n\tteamifyPrep()\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiprasmel%2Fgit-historical-blame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiprasmel%2Fgit-historical-blame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiprasmel%2Fgit-historical-blame/lists"}