Skip to content

Git Co-Author Injection Fails for Unquoted Commit Messages #15

@akramcodez

Description

@akramcodez

Description

addCoAuthorToGitCommit relies on a regex that requires the commit message passed to -m to be quoted:

const messagePattern = /(-m\s+)(['"])((?:\\.|[^\\])*?)(\2)/;

This matches -m "msg" or -m 'msg', but fails for valid Git commands like -m msg (single-word messages).

Impact

  • Co-author attribution is silently skipped for valid git commits
  • Feature behaves inconsistently depending on commit message format

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