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.
Changes made
Example template for use, based on default template:
Assuming we are working on a git branch named "BBR-3932" this would replace all the {{currentBranch}} instances.
Response example:
This format could be adjusted per user through the local prompt template.
Fixes #10