Skip to content

No update of commit message #30

Description

@matawed

When using this hook my commit message content which is provided to this hook is in format

commit msg

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date:      Thu Oct 31 15:54:52 2024 +0100
#
# On branch mt/TEST-1234

So it always returns here as pattern (branch name) is in content.

I'm wondering a bit about this change, because the whole content is now checked for pattern. Shouldn't it be only the lines not starting with #?

My setup

repos:
  - repo: https://github.com/milin/giticket 
    rev: v1.4
    hooks:
      - id: giticket
        args: [
            "--mode=regex_match",
            '--regex="[A-Z]+-[0-9]{4,8}"',
            "--format={commit_msg}


            Issue: {ticket}


            ",
          ]

steps to reproduce:

git checkout -b mt/TEST-1234
git commit --amend -S
...
giticket.................................................................Passed
...
git log -1
# message not updated

git version: 2.43.0
OS: Ubuntu 24.04

What am I doing wrong?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions