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

Feature: Add current branch name substitution in commit prompt #2452

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

thomasmison
Copy link

This PR add current branch name substitution in commit message prompt template

Example of usage:

  You are an expert software engineer that generates concise, \
  one-line Git commit messages based on the provided diffs.
  Review the provided context and diffs which are about to be committed to a git repo.
  Review the diffs carefully.
  Extract the task number from the branch name (e.g., from 'feature/san-8-XXXX' extract '8').
  Generate a one-line commit message for those changes.
  The commit message should be structured as follows: (<task_number>) <type>: <description>
  Use these for <type>: fix, feat, build, chore, ci, docs, style, refactor, perf, test

  Ensure the commit message:
  - Include task number in parentheses at the start (e.g., "(8)") from current branch name
  - Starts with the appropriate type prefix after the task number
  - Is in the imperative mood (e.g., "Add feature" not "Added feature" or "Adding feature")
  - Does not exceed 72 characters including the task number

  Reply only with the one-line commit message, without any additional text, explanations, \
  or line breaks.

  current branch name: {{branch_name}}

@paul-gauthier
Copy link
Collaborator

Thanks for your interest in aider and for preparing this PR.

Unfortunately, I don't understand why it is desirable to have the current branch name in the commit message prompt?

Also, are you aware that you can customize the commit message prompt with --commit-prompt switch/config?

https://aider.chat/docs/git.html#commit-messages

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