Skip to content

Latest commit

 

History

History
496 lines (348 loc) · 18.7 KB

File metadata and controls

496 lines (348 loc) · 18.7 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[0.3.2] - 2026-05-24

Added

  • Auto-create commit-msg.yaml config file on install when no config exists
    • Creates default config at workspace root with recommended settings
    • Skips creation if commit-msg.yaml or .commit-msg.yaml already exists
    • Non-fatal: warns on write failure without blocking installation

[0.3.1] - 2026-05-24

Changed

  • Drop Node.js < 22 support; minimum required version is now 22.0.0
  • Upgrade major dependencies: TypeScript 6, Vitest 4, commander 14, lint-staged 16
  • Replace ts-node with tsx for all dev scripts (fixes ESM compatibility)
  • Update TypeScript module settings to Node16 (required by TS 6)
  • Simplify CI matrix to Node.js 22.x and 24.x only

Removed

  • Remove dev:compat, dev:node18, dev:node20 scripts
  • Remove ts-node dependency
  • Remove tsconfig.node18.json, tsconfig.node20.json, tsconfig.compat.json

[0.3.0] - 2026-05-23

Added

  • Add YAML config file support (commit-msg.yaml / .commit-msg.yaml)
    • Support add_change_id, add_co_developed_by, add_signed_off_by, and strip_noreply_trailers settings
    • YAML config takes priority over git config when present
  • Add add_signed_off_by configuration to automatically insert Signed-off-by trailer
    • Reads identity from git config user.name and git config user.email
    • Supported in YAML config and git config (commitmsg.signedoffby)
    • Skips duplicate insertion and temporary commits (fixup!/squash!)
  • Add strip_noreply_trailers configuration to remove trailers with noreply emails
    • Comma-separated list of trailer keys to check (e.g., co-authored-by,signed-off-by)
    • Removes matching trailers whose email contains "noreply" (case-insensitive)
    • Supported in YAML config and git config (commitmsg.stripnoreplytrailers)

Changed

  • Refactor config loading into three-layer architecture
    • Split getGitConfig() into loadGitConfig() (git-only) and loadConfig() (unified: YAML-first, git-fallback)
    • Add loadYamlConfig() for YAML config file parsing
  • Add js-yaml dependency for YAML config file parsing

[0.2.15] - 2026-02-24

Added

  • Add file-based cache for auto-upgrade version checks
    • Use XDG_CACHE_HOME on Linux/macOS, LOCALAPPDATA on Windows
    • Respect check interval (1 hour default) to avoid frequent npm requests
  • Add 6 test cases to protect auto-upgrade flow

Changed

  • Replace update-notifier with direct latestVersion for reliable auto-upgrade
    • update-notifier spawns async detached process; notifier.update never populated in same run
    • Use latestVersion() for synchronous fetch within the same process
  • Change default update check interval from 8 hours to 1 hour
  • Use npm install -g @latest instead of npm update -g to force latest version
    • npm update may report "up to date" without actually upgrading

Fixed

  • Fix auto-upgrade updating wrong installation (global vs local node_modules)
    • Detect if running from project's node_modules; update the correct installation
    • Add cwd when spawning local npm install for project updates
  • Fix "version still old" after upgrade when running from local project

Removed

  • Remove update-notifier and @types/update-notifier dependencies

[0.2.14] - 2026-03-16

Added

  • Add Cursor agent support via CURSOR_AGENT=1 environment variable
  • Add remove value for commit-msg.codevelopedby to strip matching AI trailers without adding Co-developed-by (skips fixup!/squash!)

Changed

  • Filter made-with trailer when adding Co-developed-by

[0.2.13] - 2026-02-24

Added

  • Add Antigravity IDE support
    • Add __CFBundleIdentifier (com.google.antigravity) and ANTIGRAVITY_AGENT environment variable detection
    • Enable tracking contributions from Antigravity IDE
    • Add comprehensive test coverage for Antigravity environment variables

Changed

  • Match duplicate trailers by username instead of full user info when adding Co-developed-by
    • Previously compared full "Name " string, causing Cursor noreply@cursor.com and Cursor cursoragent@cursor.com to be treated as different users
    • Now compare only the username part and ignore the email for deduplication
    • Both usernames must be non-empty; correctly deduplicate same-identity different-email trailers
    • Add extractUsernameFromTrailer function and test cases for Cursor scenario

[0.2.11] - 2026-02-13

Added

  • Add Codex AI coding tool support

    • Add CODEX_MANAGED_BY_NPM and CODEX_MANAGED_BY_BUN environment variable detection
    • Enable tracking contributions from Codex AI coding tool
    • Add comprehensive test coverage for Codex environment variables
  • Add OpenCode AI coding tool support

    • Add OPENCODE environment variable detection
    • Enable tracking contributions from OpenCode AI coding tool
    • Add comprehensive test coverage for OpenCode environment variable
  • Refactor AI tool detection to use modular config files

    • Move from hardcoded array to individual configuration files for each AI tool
    • Support tool type classification (CLI, PLUGIN, IDE, OTHERS) with priority ordering
    • Improve maintainability and extensibility for adding new AI tool support
    • Each tool now has its own configuration file with type, userName, userEmail, and envVars

Changed

  • Improve Node.js version compatibility
    • Use tsx for Node.js 21+ to resolve ESM module resolution issues
    • Update script selection logic to handle Node.js 21+ correctly
    • Update compatibility documentation and test scripts

Fixed

  • Fix ESM module resolution issues in Node.js 22+

    • Replace ts-node with tsx for Node.js 22+ development mode
    • Resolve "Cannot find module" errors in clean environments
    • Ensure development mode works correctly across all supported Node.js versions
  • Fix unstable status checks in hook tests

    • Add debug output to help diagnose test failures
    • Remove environment-dependent status checks that were causing test instability
    • Keep important assertions about warning messages in stderr

Testing

  • Enhance npm pack tests with comprehensive installed package tests

    • Add tests for all CLI commands (install, exec, check-update, --help)
    • Add tests for core functionality in installed package
    • Add module import and configuration loading tests
    • Add Git integration tests in real Git repository
  • Add production build tests to verify compiled code

    • Verify module import and configuration loading from compiled code
    • Ensure consistency between development and production builds
    • Test functionality of getCoDevelopedBy() with various environment variables

[0.2.10] - 2026-01-23

Fixed

  • Avoid treating non-trailer lines like "Solution: ..." as signatures
    • Require a hyphen in trailer tokens to prevent false positives
    • Add tests for non-trailer colon lines

[0.2.9] - 2025-09-28

Added

  • Add qoder-cli support
    • Add QODER_CLI environment variable detection
    • Enable tracking contributions from Qoder CLI tool

Changed

  • Improve code coverage with comprehensive test cases
    • Add extensive test cases for uncovered lines in exec.test.ts
    • Add test coverage for clearCoDevelopedByEnvVars function
    • Add test cases for filterDuplicateTrailers edge cases
    • Add comprehensive test suites for utility functions
    • Add error handling test cases for install command
    • Configure vitest coverage reporting with v8 provider

[0.2.8] - 2025-09-28

Added

  • Make install command the default when no arguments provided

    • When no arguments are provided, the install command will be executed by default
    • Improves user experience by reducing the need to remember the install command
  • Implement automatic hook upgrade functionality

    • Add COMMIT_MSG_HOOK_VERSION and COMMIT_MSG_HOOK_PATH environment variables to hook template
    • Implement dynamic version checking in exec.ts that parses version from template file
    • Automatically regenerate outdated hooks
    • Ensure hooks are automatically upgraded to match the current template version when the package is updated

Changed

  • Reuse handleInstallCommand and handleExecCommand functions
    • Refactor code to reuse command handler functions for better maintainability
    • Consolidate duplicated logic in command implementations

Fixed

  • Improve merge commit detection logic
    • Enhance the algorithm for detecting merge commits
    • Provide more accurate detection of merge commits during hook execution

[0.2.7] - 2025-09-26

Added

  • Add direct execution mode for commit-msg hook
    • Allow direct execution of commit-msg logic without installing as a Git hook
    • Improve flexibility for different usage scenarios

Changed

  • Use minimatch for env var glob matching
    • Replace custom glob matching implementation with minimatch library
    • Improve reliability and consistency of environment variable matching

Fixed

  • Improve cursor/qoder detection in SSH/DevContainer

    • Fix issue with cursor/qoder detection when running in SSH or DevContainer environments
    • Enhance compatibility with different development environments
  • Set --verbose as default for check-update command

    • Make check-update command verbose by default for better user feedback
    • Improve visibility of update checking process

[0.2.6] - 2025-09-24

Added

  • Implement duplicate trailer filtering for Co-developed-by
    • Filter out duplicate trailers that have the same user info as the CoDevelopedBy trailer
    • Prevent duplicate entries when AI tools add both Co-developed-by and Signed-off-by trailers

Changed

  • Enhance Change-Id generation with timestamp and timezone info

    • Include timestamp and timezone information in Change-Id generation for better uniqueness
    • Improve Change-Id generation to be more robust and unique
  • Enhance merge commit detection and add comprehensive tests

    • Improve merge commit detection logic to be more accurate
    • Add comprehensive test coverage for merge commit detection scenarios

Fixed

  • Resolve -v flag conflict between --version and --verbose

    • Fix conflict where -v was being interpreted as --verbose instead of --version
    • Ensure -v flag works correctly for version display
  • Prevent update-notifier from updating timestamp in checkForUpdatesOnly

    • Fix issue where checkForUpdatesOnly was incorrectly updating the last update check timestamp
    • Ensure checkForUpdatesOnly only checks for updates without modifying timestamps

[0.2.5] - 2025-09-24

Added

  • Add support for commit-msg and commitmsg configuration prefixes
    • Add commit-msg.changeid and commitmsg.changeid as alternatives to gerrit.createchangeid
    • Add commit-msg.codevelopedby and commitmsg.codevelopedby as alternatives to commit-msg.coDevelopedBy
    • Provide more consistent naming and better alignment with the tool name
  • Add comprehensive documentation for all configuration options in README.md

Changed

  • Optimize getGitConfig to use single git config call with --list --includes
  • Improve merge commit detection in commit-msg hook
    • Change from checking HEAD commit parents to checking if the commit message file is '.git/MERGE_MSG'
    • Provide more reliable way to detect merge commits during the commit-msg hook execution

[0.2.4] - 2025-09-17

Added

  • Add COMMIT_MSG_TEST_NO_GLOBAL_HOOKS environment for test stability

Changed

  • Do not check local .githooks dir

Fixed

  • Remove the hook file before writing

[0.2.3] - 2025-09-16

Added

  • Add support AI coding tools: iFlow and Kiro

[0.2.2] - 2025-01-10

Added

  • Add scissors line detection for commit message processing
    • Detect Git scissors lines (>8 and 8<) in commit messages
    • Stop processing commit message content when scissors line is found
    • Support various scissors line formats with dashes and whitespace
    • Only match exact patterns: >8 or 8< (not >9, 7<, or with extra text)
    • Add comprehensive test coverage for scissors line scenarios

Fixed

  • Improve error handling to avoid stack trace display

  • Fix empty commit message handling

    • Do not process empty commit messages, let Git handle commit rejection
    • Return empty message with shouldSave: false for empty content
    • Maintain Git's expected behavior for empty commit rejections
  • Fix Signed-off-by only message handling

    • Detect commit messages containing only Signed-off-by lines and empty lines
    • Return empty message with shouldSave: false for signature-only commits
    • Prevent processing of template-only messages when using git commit -s

[0.2.0] - 2025-09-10

Added

  • Add global --verbose parameter support

    • Add global --verbose option to main program for consistent verbose output
    • Support parameter priority: command --verbose > global --verbose > environment variable
    • Create getVerboseMode() helper function for unified verbose handling
    • Maintain backward compatibility with COMMIT_MSG_VERBOSE environment variable
  • Add automatic version checking and upgrade functionality

    • Implement update-notifier integration for checking package updates
    • Add checkAndUpgrade() function for automatic version checking and upgrading
    • Add checkForUpdatesOnly() function for checking updates without upgrading
    • Add check-update command for manual update checking
    • Support UPDATE_CHECK_INTERVAL environment variable for custom check intervals (default: 24 hours)
    • Add verbose output support for version checking operations
  • Add UPDATE_CHECK_INTERVAL environment variable support

    • Allow customizing update check interval in seconds via UPDATE_CHECK_INTERVAL env var
    • Default to 24 hours if not specified
    • Support decimal formatting for time display (max 4 decimal places, remove trailing zeros)
    • Apply to both checkAndUpgrade and checkForUpdatesOnly functions

Changed

  • Improve error handling and update check integration

    • Remove duplicate checkAndUpgrade calls in error handling paths
    • Ensure update checks run on both successful and failed command executions
    • Add exitOverride to Commander.js for handling parsing errors with update checks
    • Improve error propagation to allow update operations before exit
  • Enhance verbose output for version checking

    • Add detailed logging for update check intervals and cache status
    • Improve time formatting with proper decimal precision
    • Add verbose output support for check-update command
    • Show comprehensive update information when verbose mode is enabled

Fixed

  • Resolve npm upgrade hang issue after successful installation

    • Add --yes --force flags to npm update commands for non-interactive execution
    • Set npm_config_yes, npm_config_force, and CI environment variables in spawn options
    • Implement proper process cleanup with resolved flag and exit event handling
    • Fix timeout handling to prevent hanging after successful npm operations
  • Fix command execution error handling

    • Replace process.exit(1) with throw error in command catch blocks
    • Ensure update checks are triggered even when commands fail with missing arguments
    • Improve error handling flow to maintain update check functionality

[0.1.14] - 2025-01-27

Added

  • Add -v short parameter support for version display
    • Support both commit-msg -v and commit-msg --version commands
    • Provide more convenient way to check version information
    • Add comprehensive test coverage for short parameter functionality

Changed

  • Update Commander.js version configuration to support both short and long parameters
  • Enhance test suite with additional version parameter tests

[0.1.13] - 2025-09-03

Added

  • Add comprehensive test suite for commit-msg.hook template

Changed

  • Improve commit-msg hook template with enhanced debug capabilities

[0.1.12] - 2025-08-31

Added

  • Add Qwen Code commit detection via environment variable
    • Detect commits initiated by Qwen Code v0.0.8 or higher through QWEN_CODE=1
    • Enable tracking contributions from the Qwen Code AI assistant

Changed

  • Remove wildcard environment variable matching logic
    • Simplify environment variable matching by removing special case handling for '*'
    • Remove obsolete wildcard tests for CLAUDECODE and QWEN_CODE
    • Maintain compatibility with CURSOR_TRACE_ID wildcard configuration

Fixed

  • Ensure package compatibility with Node.js 18+ for npm publishing
    • Update package configuration and build settings for Node.js 18+ compatibility
    • Fix issues that prevented successful npm publishing

[0.1.11] - 2025-08-30

Added

  • Add merge commit detection to skip processing
    • Automatically detect merge commits and skip Change-Id generation
    • Improves workflow when merging branches with existing Change-Ids

Changed

  • Improve GitHub Actions workflows
    • Add workflows for testing, building, and publishing
    • Add check for bad whitespaces in CI
    • Fix Node.js 20.x compatibility issues

Removed

  • Remove duplicate template files
    • Clean up redundant template files in the repository

[0.1.10] - 2025-08-23

Fixed

  • Ensure compiled bin files have executable permissions

    • Created custom build script that sets executable permissions on compiled bin files
    • Fixed issue where commit-msg command was not executable after npm pack or npm publish
    • Added scripts/build.js with custom build logic
    • Updated package.json build script to use new build process
    • Build script now explicitly sets executable permissions on bin files
  • Run prepack instead of postinstall for release

    • Remove postinstall script that required tsc during installation
    • Call "npm run build" by introducing new prepack stage
    • Add files section to package.json to ensure proper distribution
    • Fixes the issue where users would get 'tsc not found' error when installing the package globally

[0.1.6] - 2025-08-22

Added

  • Support installing commit-msg hook outside git repository with global core.hooksPath
    • Check for global core.hooksPath when not in a Git repository
    • Install hook in global hooks directory if set
    • Add proper error handling for relative paths

[0.1.5] - 2025-08-22

Fixed

  • Ensure build process doesn't depend on globally installed TypeScript

    • Resolved tsc: command not found error during package installation by changing build script in package.json to use npx tsc instead of directly calling tsc
    • This ensures that the TypeScript compiler is properly located even when it's not globally installed
  • Addressed compatibility issue with @types/node dependency

    • Changed dependency from ^24.3.0 to ^22.0.0 for better Node.js version compatibility
    • Using Node.js 22.x (LTS) instead of Node.js 24.x (future version)