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

feat(config.ts): add OCO_MESSAGE_TEMPLATE_PLACEHOLDER configuration i… #208

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

seho-dev
Copy link
Contributor

see #205

…tem to allow users to customize the message template placeholder

feat(commit.ts): add check for message templates in extraArgs and replace OCO_MESSAGE_TEMPLATE_PLACEHOLDER with generated commit message if found
docs(README.md): add documentation for OCO_MESSAGE_TEMPLATE_PLACEHOLDER configuration item and how to use it in the command line (di-sukharev#205)
@seho-dev
Copy link
Contributor Author

@di-sukharev

@di-sukharev
Copy link
Owner

sorry to be sooo late, was winning top 1 in github hackathon with OpenCommit :)

will take a look

@di-sukharev di-sukharev reopened this Jun 19, 2023
@di-sukharev di-sukharev merged commit 3c0a271 into di-sukharev:master Jul 5, 2023
@mreduar
Copy link

mreduar commented Jul 14, 2023

This does not work for me. When executing for example oco 'MR2-1167: $message' it gives an error.

➜ oco 'MR2-1167: $message'
│
┌  open-commit
│
◇  1 staged files:
│
◇  📝 Commit message generated
│
└  Commit message:
——————————————————
MR2-1167: fix(Invoice.php): add 'discount' attribute to the $appends array to include it in the model's attributes

The 'discount' attribute was missing from the $appends array in the Invoice model, causing it to not be included in the model's attributes. This fix adds the 'discount' attribute to the $appends array, ensuring that it is included in the model's attributes.
——————————————————

│
│
◇  📝 Commit message generated
│
└  ✖ Command failed with exit code 1: git commit -m MR2-1167: fix(Invoice.php): add 'discount' attribute to the $appends array to include it in the model's attributes

The 'discount' attribute was missing from the $appends array in the Invoice model, causing it to not be included in the model's attributes. This fix adds the 'discount' attribute to the $appends array, ensuring that it is included in the model's attributes. MR2-1167: $message
error: pathspec 'MR2-1167: $message' did not match any file(s) known to git

I have already configured OCO_MESSAGE_TEMPLATE_PLACEHOLDER in different ways and it does not work.

@EcomGraduates
Copy link

This does not work for me. When executing for example oco 'MR2-1167: $message' it gives an error.

➜ oco 'MR2-1167: $message'
│
┌  open-commit
│
◇  1 staged files:
│
◇  📝 Commit message generated
│
└  Commit message:
——————————————————
MR2-1167: fix(Invoice.php): add 'discount' attribute to the $appends array to include it in the model's attributes

The 'discount' attribute was missing from the $appends array in the Invoice model, causing it to not be included in the model's attributes. This fix adds the 'discount' attribute to the $appends array, ensuring that it is included in the model's attributes.
——————————————————

│
│
◇  📝 Commit message generated
│
└  ✖ Command failed with exit code 1: git commit -m MR2-1167: fix(Invoice.php): add 'discount' attribute to the $appends array to include it in the model's attributes

The 'discount' attribute was missing from the $appends array in the Invoice model, causing it to not be included in the model's attributes. This fix adds the 'discount' attribute to the $appends array, ensuring that it is included in the model's attributes. MR2-1167: $message
error: pathspec 'MR2-1167: $message' did not match any file(s) known to git

I have already configured OCO_MESSAGE_TEMPLATE_PLACEHOLDER in different ways and it does not work.

I can confirm this bug. It's happening to me as well I tried oco '$msg #someticketnumber' as well as '#some ticket number $msg'

same error

@di-sukharev
Copy link
Owner

will take a look now

@di-sukharev
Copy link
Owner

well this code doesnt account for a single commit message e.g. like this:

chore(README.md): update OCO_DESCRIPTION and OCO_EMOJI variable descriptions for OpenCommit config
feat(README.md): add OCO_MODEL variable description for OpenCommit config
fix(README.md): update OCO_MESSAGE_TEMPLATE_PLACEHOLDER and OCO_PROMPT_MODULE variable descriptions for OpenCommit config

it appends $msg in the very first line like this:

MSG_HERE: chore(README.md): update OCO_DESCRIPTION and OCO_EMOJI variable descriptions for OpenCommit config
feat(README.md): add OCO_MODEL variable description for OpenCommit config
fix(README.md): update OCO_MESSAGE_TEMPLATE_PLACEHOLDER and OCO_PROMPT_MODULE variable descriptions for OpenCommit config

im not sure if this really helps, so lets see how this PR manages the same problem #160

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.

4 participants