Skip to content

feat(config): Add options to skip commit and push prompts #504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Sma1lboy
Copy link

@Sma1lboy Sma1lboy commented Jul 31, 2025

This pull request introduces one new configuration options to streamline the commit workflow by skipping unnecessary confirmation steps.

I've been using these changes locally and they have significantly improved my workflow, allowing for faster commits with readable messages without the interruption of prompts. I believe this will be a valuable addition for many users who prefer a more automated process.

Changes:

  • OCO_SKIP_COMMIT_CONFIRM: When set to true, this option skips the commit message confirmation prompt and automatically commits with the generated message. This is useful for users who trust the generated messages and want to speed up their workflow.

These options can be configured via environment variables or the opencommit config file.

Local Usage Log:

Here's an example of the streamlined workflow in action from my local environment:

./out/cli.cjs
┌  open-commit
│
◇  2 staged files:
  src/commands/commit.ts
  src/commands/config.ts
│
◇  📝 Commit message generated
│
└  Generated commit message:
——————————————————
feat(config): add OCO_SKIP_COMMIT_CONFIRM to skip confirmation prompt
feat(config): add OCO_SKIP_PUSH_PROMPT to skip push prompt
refactor(commit): use config.OCO_SKIP_COMMIT_CONFIRM instead of direct skipCommitConfirmation
refactor(commit): use config.OCO_SKIP_PUSH_PROMPT to control git push behavior
——————————————————
│
◇  ✔ Successfully committed
│
└  [feat/adding-skip-commit-and-skip-push 6fc7274] feat(config): add OCO_SKIP_COMMIT_CONFIRM to skip confirmation prompt feat(config): add OCO_SKIP_PUSH_PROMPT to skip push prompt refactor(commit): use config.OCO_SKIP_COMMIT_CONFIRM instead of direct skipCommitConfirmation refactor(commit): use config.OCO_SKIP_PUSH_PROMPT to control git push behavior
 2 files changed, 41 insertions(+), 5 deletions(-)

I hope this pull request will be accepted. The constant prompting can be tedious, and this change provides a much-needed quality-of-life improvement for users who want a faster, more direct commit process.

@di-sukharev di-sukharev changed the base branch from master to dev July 31, 2025 17:25
@di-sukharev di-sukharev changed the base branch from dev to master July 31, 2025 17:26
@di-sukharev
Copy link
Owner

hi @Sma1lboy please target your PR to dev branch

@Sma1lboy Sma1lboy changed the base branch from master to dev August 1, 2025 00:58
@Sma1lboy
Copy link
Author

Sma1lboy commented Aug 1, 2025

Owner

got it, I'll do it tonight

@di-sukharev
Copy link
Owner

you need to merge dev into your branch manually

@Sma1lboy Sma1lboy force-pushed the feat/adding-skip-commit-and-skip-push branch from 23cbd04 to 4cc31a7 Compare August 2, 2025 00:24
@Sma1lboy
Copy link
Author

Sma1lboy commented Aug 2, 2025

hi @di-sukharev di, I just manually merged it.

@@ -86,7 +86,7 @@ ${commitMessage}
${chalk.grey('——————————————————')}`
);

const userAction = skipCommitConfirmation
const userAction = skipCommitConfirmation || config.OCO_SKIP_COMMIT_CONFIRM
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aint skipCommitConfirmation does exactly what you also implemented?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

@Sma1lboy Sma1lboy Aug 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm so sorry for late response. You're right, but I really prefer to put it at the config level rather than using oco --yes every time, although I could create an alias in my shell environment. 🤔

From another perspective, I want to keep the config standard and make this content worthy of being managed through config for a unified trigger process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants