giticket icon indicating copy to clipboard operation
giticket copied to clipboard

No update of commit message

Open matawed opened this issue 1 year ago • 2 comments

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?

matawed avatar Nov 03 '24 13:11 matawed

https://github.com/milin/giticket/pull/31

matawed avatar Nov 04 '24 17:11 matawed

What am I doing wrong? @matawed You were not doing anything wrong. I have the same issue.

dhandy2013 avatar Dec 03 '24 23:12 dhandy2013