{"id":44465710,"url":"https://github.com/andymeneely/git-churn","last_synced_at":"2026-02-12T20:12:35.492Z","repository":{"id":55971635,"uuid":"171410220","full_name":"andymeneely/git-churn","owner":"andymeneely","description":"(ALPHA) A fast tool for collecting code churn metrics from git repositories.","archived":false,"fork":false,"pushed_at":"2025-04-01T16:54:09.000Z","size":4609,"stargazers_count":12,"open_issues_count":10,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T17:46:47.507Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/andymeneely.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":"2019-02-19T05:21:34.000Z","updated_at":"2025-04-01T16:35:48.000Z","dependencies_parsed_at":"2024-06-19T13:34:26.827Z","dependency_job_id":"eca9f44b-90a4-430d-a2e5-6c6429e99f30","html_url":"https://github.com/andymeneely/git-churn","commit_stats":{"total_commits":54,"total_committers":3,"mean_commits":18.0,"dds":0.5,"last_synced_commit":"0926aeb302af1739e517845ca1e8ee239fa15933"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/andymeneely/git-churn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andymeneely%2Fgit-churn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andymeneely%2Fgit-churn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andymeneely%2Fgit-churn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andymeneely%2Fgit-churn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andymeneely","download_url":"https://codeload.github.com/andymeneely/git-churn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andymeneely%2Fgit-churn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29380137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T19:05:20.189Z","status":"ssl_error","status_checked_at":"2026-02-12T19:01:44.216Z","response_time":55,"last_error":"SSL_read: 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":[],"created_at":"2026-02-12T20:12:34.857Z","updated_at":"2026-02-12T20:12:35.486Z","avatar_url":"https://github.com/andymeneely.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-churn\n\nA fast tool for collecting code churn metrics from git repositories.\n\n# Installation\nYou will need Go language installed on your system. Ref: https://golang.org/doc/install\n\n```\n  $ git clone https://github.com/andymeneely/git-churn\n  $ cd git-churn\n  $ go install github.com/andymeneely/git-churn\n  $ go build\n ```\n\nTo run all the test cases:\n\n```\n  $ go test -v ./...\n```\n\n# Usage\n\nIn general, `git churn` works much like `git log`, with some additional options.\n\nThe `--repo` flag takes either github URL of the repo in which case it will clone the repo into the local memory and performs the operations, or you can specify the path to the cloned repo on your system. Use `\".\"` if the working directory is the repo to be used\nShow basic churn metrics for a specific commit (compared to it's parent) and file:\n```\n  $ ./git-churn --help\n  $ ./git-churn --repo https://github.com/ashishgalagali/SWEN610-project --commit c800ce62fc8a10d5fe69adb283f06296820522c1 --filepath src/main/java/com/webcheckers/ui/WebServer.java\n  $ ./git-churn --repo https://github.com/andymeneely/git-churn --commit 00da33207bbb17a149d99301012006fbd86c80e4 --filepath testdata/file.txt --whitespace=false\n  $ /path/to/git-churn --repo /path/to/repo --commit c800ce62fc8a10d5fe69adb283f06296820522c1 --filepath src/main/java/com/webcheckers/ui/WebServer.java\n```\n\nTo get churn metrics for a range of commit:\n```\n  $ ./git-churn --repo https://github.com/ashishgalagali/SWEN610-project --commit c800ce62fc8a10d5fe69adb283f06296820522c1..5a2bf9f4da3de056dde3d9a9c18859de124d2602 --filepath src/main/java/com/webcheckers/ui/WebServer.java \n  $ ./git-churn --repo https://github.com/ashishgalagali/SWEN610-project --commit c800ce62fc8a10d5fe69adb283f06296820522c1...5a2bf9f4da3de056dde3d9a9c18859de124d2602 --filepath src/main/java/com/webcheckers/ui/WebServer.java --whitespace=false\n  $ ./git-churn --repo https://github.com/ashishgalagali/SWEN610-project --commit c800ce62fc8a10d5fe69adb283f06296820522c1...5a2bf9f4da3de056dde3d9a9c18859de124d2602 --whitespace=false \n  $ /path/to/git-churn --repo . --commit c800ce62fc8a10d5fe69adb283f06296820522c1..5a2bf9f4da3de056dde3d9a9c18859de124d2602 --filepath src/main/java/com/webcheckers/ui/WebServer.java\n\n```\n\nTo show the aggregated churn metrics for a specific commit:\n```\n $ ./git-churn --repo https://github.com/andymeneely/git-churn --commit 00da33207bbb17a149d99301012006fbd86c80e4  --whitespace=false\n $ ./git-churn --repo https://github.com/ashishgalagali/SWEN610-project --commit c800ce62fc8a10d5fe69adb283f06296820522c1...5a2bf9f4da3de056dde3d9a9c18859de124d2602 --whitespace=false \n\n```\n\n# Options\n```\nFlags:\n  -a, --aggregate string   Aggregate the churn metrics. \"commit\": Aggregates all files in a commit. \"all\": Aggregate all files all commits and all files (default \"commit\")\n  -c, --commit string      Commit hash for which the metrics has to be computed\n  -f, --filepath string    File path for the file on which the commit metrics has to be computed\n  -h, --help               help for git-churn\n  -j, --json               Writes the JSON output to a file within a folder named churn-details\n  -p, --print              Prints the output in a human readable format (default true)\n  -r, --repo string        Git Repository URL on which the churn metrics has to be computed\n  -w, --whitespace         Excludes whitespaces while calculating the churn metrics is set to false (default true)\n```\n\n# Sample Output\n\nFor a commit range\n```\n{\n  \"BaseCommitId\": \"8b0c2116cea2bbcc8d0075e762b887200a1898e1\",\n  \"CommitDetails\": [\n    {\n      \"CommitId\": \"3895dfa31c54adf83fdaffd90cf1b5fd4e5d7ff0\",\n      \"CommitAuthor\": \"mcuadros@gmail.com\",\n      \"DateTime\": \"2019-11-01 10:06:13 +0100 +0100\",\n      \"CommitMessage\": \"Merge pull request #1235 from jmahler/master\\n\\nfix broken link (s/ftp/https/)\",\n      \"ChurnMetrics\": [\n        {\n          \"FilePath\": \"_examples/ls-remote/main.go\",\n          \"DeletedLinesCount\": 1,\n          \"SelfChurnCount\": 0,\n          \"InteractiveChurnCount\": 1,\n          \"ChurnDetails\": {\n            \"b4fba7ede146be79cf65b89975250cf6869fb409\": \"v.cocaud@gmail.com\"\n          }\n        },\n        {\n          \"FilePath\": \"_examples/merge_base/helpers.go\",\n          \"DeletedLinesCount\": 2,\n          \"SelfChurnCount\": 0,\n          \"InteractiveChurnCount\": 2,\n          \"ChurnDetails\": {\n            \"66c4a36212ced976c33712ca4fb6abc6697f2654\": \"David.Pordomingo.F@gmail.com\"\n          }\n        }\n      ]\n    },\n    {\n      \"CommitId\": \"3ed21ff5df781c947aebcf1d602269b1206116e3\",\n      \"CommitAuthor\": \"jmmahler@gmail.com\",\n      \"DateTime\": \"2019-10-31 18:05:28 -0700 -0700\",\n      \"CommitMessage\": \"fix broken link (s/ftp/https/)\\n\\nSigned-off-by: Jeremiah Mahler \u003cjmmahler@gmail.com\u003e\\n\",\n      \"ChurnMetrics\": [\n        {\n          \"FilePath\": \"_examples/ls-remote/main.go\",\n          \"DeletedLinesCount\": 1,\n          \"SelfChurnCount\": 0,\n          \"InteractiveChurnCount\": 1,\n          \"ChurnDetails\": {\n            \"b4fba7ede146be79cf65b89975250cf6869fb409\": \"v.cocaud@gmail.com\"\n          }\n        },\n        {\n          \"FilePath\": \"_examples/merge_base/helpers.go\",\n          \"DeletedLinesCount\": 2,\n          \"SelfChurnCount\": 0,\n          \"InteractiveChurnCount\": 2,\n          \"ChurnDetails\": {\n            \"66c4a36212ced976c33712ca4fb6abc6697f2654\": \"David.Pordomingo.F@gmail.com\"\n          }\n        }\n      ]\n    }\n  ]\n}\n```\n\nFor all files in a commit aggregated \n```\n{\n  \"BaseCommitId\": \"99992110e402f26ca9162f43c0e5a97b1278068a\",\n  \"AggCommitDetails\": [\n    {\n      \"CommitId\": \"180ec07da5d7a415b48fd3d9f7d5c9dd2925780e\",\n      \"CommitAuthor\": \"ashishgalagali@gmail.com\",\n      \"DateTime\": \"2020-03-28 00:59:14 -0400 -0400\",\n      \"CommitMessage\": \"Merge pull request #19 from andymeneely/diffMetrics\\n\\nGetting git diff metrics for a given commit and file\",\n      \"AggChurnMetrics\": {\n        \"FilesCount\": 4,\n        \"TotalDeletedLinesCount\": 25,\n        \"TotalSelfChurnCount\": 22,\n        \"TotalInteractiveChurnCount\": 3\n      }\n    },\n    {\n      \"CommitId\": \"3854e533318df4f5bb9a059c76ddd8bb2464a620\",\n      \"CommitAuthor\": \"ashishgalagali@gmail.com\",\n      \"DateTime\": \"2020-03-28 00:57:17 -0400 -0400\",\n      \"CommitMessage\": \"Diff Merics whitespace excluded\\n\",\n      \"AggChurnMetrics\": {\n        \"FilesCount\": 4,\n        \"TotalDeletedLinesCount\": 25,\n        \"TotalSelfChurnCount\": 22,\n        \"TotalInteractiveChurnCount\": 3\n      }\n    }\n  ]\n}\n```\n\n# Metrics\n\n* Lines added\n* Lines deleted\n* Churn (lines added + deleted)\n* Number of authors\n* Number of committers\n* Inn\n\n\n# UML\nGenerated using https://www.dumels.com/\n\n![Alt text](git-churn_UML.svg?raw=true \"UML\")\n\n# Profiling\n\nTo generate profiling files, execute the following commands inside the metrics' directory where the test cases are present:\n\n```\ngo test -cpuprofile cpu.prof\ngo test -memprofile mem.prof\n```\n\nIn order to visualize and see the profiling data on to a web page, execute the pollowing commands:\n\n```\ngo tool pprof -http=localhost:12345 cpu.prof \ngo tool pprof -http=localhost:12346 mem.prof \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandymeneely%2Fgit-churn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandymeneely%2Fgit-churn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandymeneely%2Fgit-churn/lists"}