Skip to content
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

Allow for commit prefix #159

Closed
wants to merge 4 commits into from
Closed

Conversation

amitayk
Copy link

@amitayk amitayk commented May 4, 2023

A new configuration option called "prefix" has been added. This option allows you to set a default prefix for each commit. It also supports regular expressions (regex) to match the prefix against the branch name.

Here is a simple example of using the prefix option:

oc config set prefix amyu98-commit:

This will result in:

amyu98-commit: Some lovely AI commit content

Below is an example of using a basic regex with the prefix option:

oc config set prefix /^([a-zA-Z]+-\d+)/

For the local branch "DEV-12345-commit-prefix", this will result in:

DEV-12345: Some lovely AI commit content

amitayk added 4 commits May 4, 2023 15:41
… generated message

feat(config.ts): add prefix configuration option to be used in the generated message. Add validation to ensure prefix is not empty.
…x and message content

fix(config.ts): fix config validation for prefix to allow non-empty values
…egex pattern in git branch name

feat(api.ts): add support for generating commit message prefix from git branch name if regex pattern is not provided
feat(api.ts): add getCurrentGitBranch function to get current git branch name
feat(api.ts): add generatePrefixFromRegex function to generate prefix from regex pattern in git branch name
@amitayk amitayk marked this pull request as draft May 4, 2023 16:27
@amitayk amitayk changed the base branch from dev to master May 4, 2023 16:30
@amitayk amitayk closed this May 4, 2023
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.

1 participant