{"id":16780118,"url":"https://github.com/jackgerrits/git-changelog-generator","last_synced_at":"2025-08-03T19:14:03.525Z","repository":{"id":81322856,"uuid":"283917976","full_name":"jackgerrits/git-changelog-generator","owner":"jackgerrits","description":"Git repository changelog generator ","archived":false,"fork":false,"pushed_at":"2023-10-10T20:54:07.000Z","size":13,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T06:32:34.163Z","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/jackgerrits.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-31T01:58:03.000Z","updated_at":"2022-03-24T19:53:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"7fda0493-993a-4cb7-a3db-025b05766feb","html_url":"https://github.com/jackgerrits/git-changelog-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackgerrits%2Fgit-changelog-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackgerrits%2Fgit-changelog-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackgerrits%2Fgit-changelog-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackgerrits%2Fgit-changelog-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackgerrits","download_url":"https://codeload.github.com/jackgerrits/git-changelog-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243926072,"owners_count":20369910,"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":[],"created_at":"2024-10-13T07:34:04.969Z","updated_at":"2025-03-16T20:12:44.018Z","avatar_url":"https://github.com/jackgerrits.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Changelog Generator\nEasily generate a changelog for a git repository by filling in a template file.\n\n```\nusage: git-changelog-generator.py [-h] --file FILE --range RANGE --dir DIR\n                                  [--additional_data ADDITIONAL_DATA]\n\nExtract commits from a git repo and format according to template\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --file FILE, -f FILE  Template file to process\n  --range RANGE, -r RANGE\n                        git log range to extract commits for\n  --dir DIR, -d DIR     directory of repo to read commits from\n  --additional_data ADDITIONAL_DATA, -c ADDITIONAL_DATA\n                        Additional data values pass to template, must be in the form key=value\n```\n\nNote: The program assumes the current working directory is the in the git repository to generate the changelog for.\n\n`-r` is a passed to the git log command directly. You use things such as:\n- A commit range - `HEAD~4..HEAD` or `1.1.0..2.0.0`\n- A number of commits `-n 4`\n\n## Templating\nThe Python implementation, [Chevron](https://github.com/noahmorrison/chevron), of the [{{ Mustache }}](https://mustache.github.io/) template specification is used.\n\nThe input file is processed and according to the Mustache syntax. The values available in the template are a list of commits that are extracted from the git log as well as additional data that can be provided on the command line.\n\nA `commit` contains the following fields:\n- `subject` - Subject line of commit\n- `commit` - Full commit hash\n- `author_name` - Author name\n- `author_email` - Author email\n- `body` - Full body of commit\n- `type` - Semantic PR type of commit\n- `breaking` - If this is a breaking change, boolean\n- `pr_num` - Extracted from commits where the subject contiains `(#XXXX)`\n\nAn `author` contains the following fields:\n- `name` - Author name\n- `email` - Author email\n\nData passed to template is as follows:\n- `commits` - list, each item of type `commit`\n- `authors` - list, each item of type `author`\n- `unknown_type_commits` - list, each time of type `commit`, where `type` field == `unknown`\n- `feat_type_commits` - list, each time of type `commit`, where `type` field == `feat`\n- `fix_type_commits` - list, each time of type `commit`, where `type` field == `fix`\n- `docs_type_commits` - list, each time of type `commit`, where `type` field == `docs`\n- `style_type_commits` - list, each time of type `commit`, where `type` field == `style`\n- `refactor_type_commits` - list, each time of type `commit`, where `type` field == `refactor`\n- `perf_type_commits` - list, each time of type `commit`, where `type` field == `perf`\n- `test_type_commits` - list, each time of type `commit`, where `type` field == `test`\n- `build_type_commits` - list, each time of type `commit`, where `type` field == `build`\n- `ci_type_commits` - list, each time of type `commit`, where `type` field == `ci`\n- `chore_type_commits` - list, each time of type `commit`, where `type` field == `chore`\n- `revert_type_commits` - list, each time of type `commit`, where `type` field == `revert`\n\nAdditional data can be provided as command line arguments to do things like specify a release version in the template. The `-c` argument must be passed as a `key=value` pair. For values to have spaces then just surround the entire argument in quotes `-c \"key=value\"`.\n\nIf the data does not exist then the templating engine will simply ignore the value.\n\n## Example\n\nGiven the following template file:\n```\n# Changelist\nVersion: {{version}}\n\n{{#commits}}\n- {{commit}} {{author_name}}\n  - {{subject}}\n{{/commits}}\n```\n\nRunning the following command:\n```sh\npython git-changelog-generator.py -f example-changelog.template.md -r \"HEAD~10..HEAD\" -c version=2.0\n```\n\nMay produce output similar to:\n```\n# Changelist\nVersion: 2.0\n\n- 3fc607e5cbb2cfa613b67cabf60372e726575cd6 Jack Gerrits\n  - Refactor input and basic window handling into a window object\n- 8e0fbb36329985672cb5260320836b55b9a71310 Jack Gerrits\n  - various small const and constexpr related things\n- 2cc48e7f7e0d850d5dec9a3aa4756167b35268a5 Jack Gerrits\n  - Add CLion things to gitignore\n- 84042db1612dfbffe4fda7f9625ff60005d3511c Jack Gerrits\n  - Add glm_ext header to deal with unknown pragma warning\n- 0e3928524e8297b4f485fc48b484765d2d741b40 Jack Gerrits\n  - Fix build on Ubuntu\n- cf74b2fa96501d5d2aea9403fcff34030abb2876 Jack Gerrits\n  - Applying clang-tidy fixes\n- 785b85bf69ba72d72d88286fe632003c9904512c Jack Gerrits\n  - Set CMake policy CMP0092 to new to avoid warnings with MSVC\n- e7043c5bdac810ce906e7b13ee9d9b07eb68ed6b Jack Gerrits\n  - Run format over code\n- f125be755f1bbd9354a4292bc840f679d853c930 Jack Gerrits\n  - Bring in fmt\n- f2b740becfa982ef4e999f44842ba97996e12e38 Jack Gerrits\n  - Remove shader from target sources\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackgerrits%2Fgit-changelog-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackgerrits%2Fgit-changelog-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackgerrits%2Fgit-changelog-generator/lists"}