This Python script is a changelog generator that creates a detailed changelog for a project based on git commit history. It identifies version changes, associates commits with issues from an issue tracker (currently supports Redmine), and generates a markdown file summarizing these changes.
- Supports different version containers like Maven (
pom.xml), NPM (package.json), and environment files. - Identifies commits associated with version changes.
- Extracts issue information from commit messages for Redmine.
- Generates a changelog in markdown format.
- Python 3
- packaging (It's temporary)
- Git repository
- Redmine issue tracker (for advanced commit information)
- Ensure Python 3 is installed on your system.
- Install packaging:
pip install packaging- Clone your git repository locally, if you haven't already.
- Navigate to the root directory of this script.
- Run the script via the command line, adjusting the arguments as needed.
python easy_changelog.py --issue-tracker-url YOUR_ISSUE_TRACKER_URL --issue-tracker-token YOUR_API_KEY --version-control-system-commit-url YOUR_VCS_COMMIT_BASE_URL -C PATH_TO_YOUR_GIT_REPOReplace placeholders (YOUR_ISSUE_TRACKER_URL, YOUR_API_KEY, YOUR_VCS_COMMIT_BASE_URL, PATH_TO_YOUR_GIT_REPO)
with applicable values.
--issue-tracker-type: Optional. Issue tracker type. Currently, onlyredmineis supported.--issue-tracker-url: Required. Base URL of your issue tracker.--issue-tracker-token: Required. API key or token for the issue tracker.--version-control-system-commit-url: Required. Base URL used in the changelog to link commits.-C/--repository-path: Optional. Path to the git directory. If not provided, the current working directory is used by default.--version-container-type: Optional. The type of version container (maven,npm,env). Default ismaven.--version-container-path: Optional. Path to the version file relative to the repository root. Default ispom.xmlfor Maven projects.-o/--output-file: Optional. Path to the output changelog file. Default isCHANGELOG.md.--version-compare-mode: Optional. Version comparison mode (full,major,minor,patch,labels). Perform the comparison up to specified version component and ignore others. It's useful for example if dev-branch contains patches or labels like-alphaor-rc.0and you want to include these changes to changelog file but do not separate it by different versions. Default isfullwhich means compare all components.
The script generates a CHANGELOG.md file (or another specified file) in the root directory of this script, documenting
all notable changes in the format recommended by Keep a Changelog.