8000 Changelog excludes signed commits when git config log.showsignature=True · Issue #397 · commitizen-tools/commitizen · GitHub
[go: up one dir, main page]

Skip to content
Changelog excludes signed commits when git config log.showsignature=True #397
Closed
@lobotmcj

Description

@lobotmcj

Description

When the git repo instance is configured to show signatures (log.showsignature=True) -- all signed commits are excluded from the changelog produced by Commitizen

Steps to reproduce

  1. git config log.showsignature true
  2. cz ch --dry-run > broken
  3. git config log.showsignature false
  4. cz ch --dry-run > fixed
  5. vimdiff broken fixed

Current behavior

Any signed commits are missing from the changelog because git.py's get_commits() retrieves just the gpg signature line

Desired behavior

The actual commit message should be retrieved and included in the changelog, regardless of the repo instance's git configuration

Suggested Fix

Change line 80 of git.py from
git_log_cmd = f"git --pretty={log_format}{delimiter} {args}"
to
git_log_cmd = f"git -c log.showsignature=False log --pretty={log_format}{delimiter} {args}"
This will ensure that log.showsignature is false for the purpose of retrieving commits within Commitizen, but will not alter the underlying git repository's configuration as the -c flag applies for that command only.

Screenshots
image

Environment

  • commitizen version: 2.17.11
  • python version: 3.6.9
  • operating system: Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0