Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Is there any way to use this in a prepare-commit-msg hook? #689

Closed
@ArgentumCation

Description

@ArgentumCation

Description

The Node version of commitizen provides a --hook flag that allows users to generate a commit message, without actually performing a commit, is there a way to replicate this behavior in the Python version?

The example prepare-commit-hook in the cz-cli documentation is something like this:

#!/bin/bash
exec < /dev/tty && node_modules/.bin/cz --hook || true

Possible Solution

A new command or flag such as cz message or cz commit --message-only that could be embedded into a git hook that would generate a commit message without performing a full commit.

Additional context

Since the commit message in cz --dry-run is output to stdout (along with the questions) there's no way to just pipe the output of that directly into .git/COMMIT_MSG

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions