Skip to content

Cannot process git commit if user did not set email #340

@Lee-W

Description

@Lee-W

Description

If users did not set their email, we'll not be able to run bump and changelog generation due to

rev, title, author, author_email, *body_list = rev_and_commit.split("\n")

Steps to reproduce

  1. git commit with no email (Ref: https://stackoverflow.com/questions/7372970/git-commit-with-no-email)
  2. Run cz bump or cz changelog

Current behavior

raises the following error

Traceback (most recent call last):
  File "....local/bin/cz", line 8, in <module>
    sys.exit(main())
  File "....local/pipx/venvs/commitizen/lib/python3.8/site-packages/commitizen/cli.py", line 295, in main
    args.func(conf, vars(args))()
  File "....local/pipx/venvs/commitizen/lib/python3.8/site-packages/commitizen/commands/bump.py", line 109, in __call__
    commits = git.get_commits()
  File "....local/pipx/venvs/commitizen/lib/python3.8/site-packages/commitizen/git.py", line 86, in get_commits
    rev, title, author, author_email, *body_list = rev_and_commit.split("\n")
ValueError: not enough values to unpack (expected at least 4, got 3)

Desired behavior

Proceeded without error

Environment

  • commitizen version: 2.14.0
  • python version: Python 3.8.3
  • operating system: Darwin

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