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(index.ts): add current git branch name to prompt #36

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

Conversation

albertcastaned
Copy link

@albertcastaned albertcastaned commented Aug 13, 2023

Changes made

  • Adds the current working git branch to the prompt, allowing to use it for context when needed. One example is using the branch name as a commit prefix, useful for Jira tickets.

Example template for use, based on default template:

suggest 10 commit messages based on the following diff:
{{diff}}
commit messages should:
 - message format should be: {{currentBranch}}: <description>

examples:
 - {{currentBranch}}: add branch to prompt
 - {{currentBranch}}: add password regex pattern
 - {{currentBranch}}: add new test cases

Assuming we are working on a git branch named "BBR-3932" this would replace all the {{currentBranch}} instances.

Response example:

response:   - BBR-3932: add current branch to prompt
 - BBR-3932: add execSync to get current branch
 - BBR-3932: replace placeholder with current branch
 - BBR-3932: add error handling for branch command
 - BBR-3932: refactor index.ts
 - BBR-3932: update diff string
 - BBR-3932: update prompt template

This format could be adjusted per user through the local prompt template.

Fixes #10

@albertcastaned albertcastaned marked this pull request as draft August 13, 2023 02:11
@albertcastaned albertcastaned marked this pull request as ready for review August 13, 2023 02:13
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.

[Suggestion] Link Jira ticket number
1 participant