Skip to content

[Bug]: After setting the oco hook, the cancellation behavior of git commit. #490

Open
@PhantasWeng

Description

@PhantasWeng

Opencommit Version

3.2.9

Node Version

22.15.1

NPM Version

11.4.1

What OS are you seeing the problem on?

No response

What happened?

After setting up oco hook set, when I use git commit, it enters the vim editor, which is normal so far.

However, once I use :q! to cancel the edit, a normal git commit would cancel the commit action, but after oco hook set, oco still commits the message I canceled.

Expected Behavior

oco should only commit when I finish with :wq, and if I use :q! to cancel editing, it should cancel the entire action.

Current Behavior

Whether it's :wq or :q!, both will commit the message.

Possible Solution

When using oco normally, it will ask Confirm the commit message? ○ Yes / ● No and then Do you want to regenerate the message? ○ Yes / ● No. The cancel action of :q! should be equivalent to No + No.

Steps to Reproduce

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions