{"id":25732080,"url":"https://github.com/xiaoshihou514/git-biance","last_synced_at":"2025-05-07T18:42:00.986Z","repository":{"id":277050540,"uuid":"926746013","full_name":"xiaoshihou514/git-biance","owner":"xiaoshihou514","description":"Visualize code contributions in a GitHub-style graph","archived":false,"fork":false,"pushed_at":"2025-04-22T05:52:02.000Z","size":65,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-01T20:03:24.031Z","etag":null,"topics":["git","rust","visualization"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xiaoshihou514.png","metadata":{"files":{"readme":"README-zh.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-03T19:38:28.000Z","updated_at":"2025-04-27T14:52:07.000Z","dependencies_parsed_at":"2025-03-01T23:28:39.435Z","dependency_job_id":null,"html_url":"https://github.com/xiaoshihou514/git-biance","commit_stats":null,"previous_names":["xiaoshihou514/git-biance"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaoshihou514%2Fgit-biance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaoshihou514%2Fgit-biance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaoshihou514%2Fgit-biance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaoshihou514%2Fgit-biance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiaoshihou514","download_url":"https://codeload.github.com/xiaoshihou514/git-biance/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252936207,"owners_count":21828107,"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":["git","rust","visualization"],"created_at":"2025-02-26T03:39:17.271Z","updated_at":"2025-05-07T18:42:00.966Z","avatar_url":"https://github.com/xiaoshihou514.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"![版本](https://img.shields.io/crates/v/git-biance)\n\ngit-鞭策是一个用rust写的，用来可视化队友干了多少活的小程序。\n\n\u003cdiv align=\"center\"\u003e⚠️请*不要*用这个来压力同事，开开玩笑就得了⚠️\u003c/div\u003e\n\n|                                `git biance --commits --plot`                                |                                `git biance --stat --plot`                                 |\n| :-----------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------: |\n| ![commits](https://github.com/user-attachments/assets/6fdcb9cd-44aa-4918-b8dd-6d3a27b850bd) | ![stats](https://github.com/user-attachments/assets/23c69509-fd12-42bc-8b46-9aa9ffe08543) |\n\n## 安装\n\n### Fedora\n\n```shell\nsudo dnf install --nogpgcheck --repofrompath 'terra,https://repos.fyralabs.com/terra$releasever' terra-release\nsudo dnf install git-biance\n```\n\n### 其他\n\n```shell\ncargo install git-biance\n```\n\n## 用法\n\n```\nUsage: git-biance [OPTIONS] [AUTHOR]\n\nArguments:\n  [AUTHOR]  Specify certain author\n\nOptions:\n  -s, --stat            Show total insertions and deletions\n  -c, --commits         Show total commits\n  -p, --plot            Visualize contributions with a graph\n  -f, --file \u003cFILE\u003e...  Show insertions and deletions on single file\n  -h, --help            Print help\n  -V, --version         Print version\n```\n\n## 集成\n\n### GitLab集成\n\n用以下流程可以实现合并请求中自动鞭策的效果，需要成员添加名为CI_AUTOCOMMENTER_API_KEY的变量，值为个人授权码：\n\n```yaml\n# 别忘了把gitlab示例的链接改了\nbiance:\n  stage: deploy\n  variables:\n    GIT_DEPTH: 0\n  script:\n    - BIANCE_COMMIT=$(git biance -c | sed ':a; N; $!ba; s/ /%20/g; s/\\n/%0A/g')\n    - BIANCE_STATS=$(find src/main/ -type f | xargs git biance -f | sed ':a; N; $!ba; s/ /%20/g; s/\\n/%0A/g')\n    - BIANCE_MSG=$(echo \"Beep%20boop%0A%0A$BIANCE_COMMIT%0A%0A$BIANCE_STATS\")\n    - 'curl --request POST --header \"PRIVATE-TOKEN: $CI_AUTOCOMMENTER_API_KEY\" \"https://your.gitlab.instance.com/api/v4/projects/$CI_PROJECT_ID/merge_requests/$CI_MERGE_REQUEST_IID/notes?body=$BIANCE_MSG\"'\n  rules:\n    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'\n```\n\n![效果](https://github.com/user-attachments/assets/ea9ae5a6-d51d-441d-9cc0-f484f34ad614)\n\n## 常见问题\n\n\u003e 有些人的名字出现了好几次是咋回事？\n\n`git鞭策`用邮箱来区分用户，但是打印的是用户名。最可能的是你的队友没用ssh，所以每次推送邮件都不一样。你可以用[git mailmap](https://git-scm.com/docs/gitmailmap)来解决这个问题，运行以下命令获取所有推送过的人的用户名和邮件：\n\n```shell\ngit log | grep Author | sort | uniq\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaoshihou514%2Fgit-biance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaoshihou514%2Fgit-biance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaoshihou514%2Fgit-biance/lists"}