{"id":17843858,"url":"https://github.com/jdrouet/git-metrics","last_synced_at":"2025-04-04T13:03:55.580Z","repository":{"id":238912735,"uuid":"797949421","full_name":"jdrouet/git-metrics","owner":"jdrouet","description":"A git extension to be able to track metrics about your project, within the git repository","archived":false,"fork":false,"pushed_at":"2025-03-27T21:58:55.000Z","size":770,"stargazers_count":89,"open_issues_count":9,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T22:32:44.166Z","etag":null,"topics":["ci","git","metrics","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/jdrouet.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["jdrouet"]}},"created_at":"2024-05-08T19:43:03.000Z","updated_at":"2025-03-27T21:52:25.000Z","dependencies_parsed_at":"2024-05-15T22:45:34.501Z","dependency_job_id":"f13dbfec-a7f6-4d08-a01c-1fad9d0f22d8","html_url":"https://github.com/jdrouet/git-metrics","commit_stats":null,"previous_names":["jdrouet/git-metrics"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdrouet%2Fgit-metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdrouet%2Fgit-metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdrouet%2Fgit-metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdrouet%2Fgit-metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdrouet","download_url":"https://codeload.github.com/jdrouet/git-metrics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247177345,"owners_count":20896631,"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","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":["ci","git","metrics","rust"],"created_at":"2024-10-27T21:27:05.696Z","updated_at":"2025-04-04T13:03:55.547Z","avatar_url":"https://github.com/jdrouet.png","language":"Rust","funding_links":["https://github.com/sponsors/jdrouet"],"categories":[],"sub_categories":[],"readme":"# Git Metrics\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fjdrouet%2Fgit-metrics.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fjdrouet%2Fgit-metrics?ref=badge_shield)\n\nRight now, if you want to track the evolution of some metrics for your project\nover time, you need an external tool to store those metrics. But these metrics\ncould be stored withing the git repository. Git provides a mechanism of notes\nthat `git-metrics` simplifies.\n\n## How to install\n\n### From sources\n\n```bash\ncargo install --git https://github.com/jdrouet/git-metrics\n```\n\n## How to use it\n\n### Locally\n\n```bash\n# fetch the remote metrics\n$ git metrics pull\n# add a new metric\n$ git metrics add binary-size \\\n    --tag \"platform.os: linux\" \\\n    --tag \"platform.arch: amd64\" \\\n    1024.0\n# push the metrics to remote\n$ git metrics push\n# log all the metrics for the past commits\n$ git metrics log --filter-empty\n# display the metrics on current commit\n$ git metrics show\nbinary-size{platform.os=\"linux\", platform.arch=\"amd64\"} 1024.0\n# display the metrics difference between commits\n$ git metrics diff HEAD~2..HEAD\n- binary-size{platform.os=\"linux\", platform.arch=\"amd64\"} 512.0\n+ binary-size{platform.os=\"linux\", platform.arch=\"amd64\"} 1024.0 (+200.00 %)\n# check the metrics against the defined rules\n$ git metrics check --show-success-rules --show-skipped-rules HEAD~2..HEAD\n[SUCCESS] binary-size{platform.os=\"linux\", platform.arch=\"amd64\"} 3.44 MiB =\u003e 3.53 MiB Δ +96.01 kiB (+2.72 %)\n    increase should be less than 10.00 % ... check\n    should be lower than 10.00 MiB ... check\n[SUCCESS] binary-size{platform.os=\"linux\", platform.arch=\"aarch64\"} 3.14 MiB =\u003e 3.14 MiB\n    increase should be less than 10.00 % ... check\n    should be lower than 10.00 MiB ... check\n```\n\n### With a github action\n\nWith `git-metrics`, using [the GitHub actions](https://github.com/jdrouet/action-git-metrics), you can even add a check to every pull request that opens on your project.\n\n![check report](asset/report-comment.png)\n\n```yaml\nname: monitoring metrics\n\non:\n  pull_request:\n    branches:\n      - main\n  push:\n    branches:\n      - main\n\n# this is required to be able to post the result of the check command\n# in a comment of the pull request\npermissions:\n  pull-requests: write\n\njobs:\n  building:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n        with:\n          # this is needed for reporting metrics\n          fetch-depth: 0\n      # set the git identity to be able to save and push the metrics\n      - uses: jdrouet/action-git-identity@main\n      - uses: jdrouet/action-git-metrics@install\n      - uses: jdrouet/action-git-metrics@execute\n        with:\n          pull: 'true'\n          # set that to true when not a pull request\n          push: ${{ github.event_name != 'pull_request' }}\n          script: |\n            add binary-size --tag \"platform: linux\" 1024\n      # add a comment message to your pull request reporting the evolution\n      - uses: jdrouet/action-git-metrics@check\n        if: ${{ github.event_name == 'pull_request' }}\n```\n\n## Related projects\n\n- GitHub action to install `git-metrics`: https://github.com/jdrouet/action-git-metrics/tree/install\n- GitHub action to execute `git-metrics`: https://github.com/jdrouet/action-git-metrics/tree/execute\n- GitHub action to report `git-metrics` checks: https://github.com/jdrouet/action-git-metrics/tree/check\n- GitHub action to report `git-metrics` diff: https://github.com/jdrouet/action-git-metrics/tree/diff\n\n## Project goals\n\n- [x] `git-metrics show` displays the metrics to the current commit\n- [x] `git-metrics add` adds a metric to the current commit\n- [x] `git-metrics remove` removes a metric from the current commit\n- [x] `git-metrics fetch` fetches the metrics\n- [x] `git-metrics push` pushes the metrics\n- [x] `git-metrics log` displays the metrics for the last commits\n- [x] `git-metrics diff` computes the diff of the metrics between 2 commits\n- [x] `git-metrics check` compares the metrics against the defined budget\n- [ ] `git-metrics page` generates a web page with charts for every metrics\n- [ ] `git-metrics import` to add metrics based on some apps output\n  - [x] from lcov file\n\n## License\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fjdrouet%2Fgit-metrics.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fjdrouet%2Fgit-metrics?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdrouet%2Fgit-metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdrouet%2Fgit-metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdrouet%2Fgit-metrics/lists"}