Option to modify or slim down commit messages?
First: Thank you! This is a fantastic project and I very much enjoy using it as a supplemental tool in my work. Please keep this going! Would be happy to support in any way that I can as well.
I've reviewed the documentation and have not found any mention of modifying or slimming down the in-depth commit messages by aider. If I have overlooked it, my sincere apologies.
The concise "overview" message at the beginning of the commit messages are great, e.g., "aider: Removed curly brackets from @param tags in docblocks for the fetchBySlugs() and create() methods."
However, I find that including the aider chat conversation into the commit message also is far too verbose and adds significant clutter. Perhaps I'm overlooking the advantages to having it this way, outside of debugging, but including the before and after of the changes within the commit message itself when this is already handled by git seems redundant, is it not?
I would like to see an option to enable/disable the conversation part of the commit messages: Anything including "# Aider chat conversation:" and afterwards. Also, I would like to see an option to modify or altogether remove the name prior to the commit message "aider: ".
Example of a current commit message:
aider: Removed cuxrly brackets from @param tags in docblocks for the fetchBySlugs() and create() methods.
# Aider chat conversation:
USER: For the @param tags in the docblocks, let's remove the {} curly bracket part that defines types because types are already defined implicitly by their use down below. Example of them to remove are {ICreateTag} and {Promise<ITag>} for the static async create() method.
ASSISTANT: Sure, I can help with that. Here are the changes:
```typescript
src/controllers/tag-controller.ts
<<<<<<< SEARCH
/**
* Fetches tags from the database by their slugs.
* This method connects to the MongoDB database, queries the 'tags' collection for documents
* where the 'slug' field matches any of the provided slugs, and returns the matching documents.
* https://github.com/async
* @param {string[]} slugs - An array of tag slugs to fetch.
* @returns {Promise<ITag[]>} - A promise that resolves to an array of tags.
*/
=======
/**
* Fetches tags from the database by their slugs.
* This method connects to the MongoDB database, queries the 'tags' collection for documents
* where the 'slug' field matches any of the provided slugs, and returns the matching documents.
* https://github.com/async
* @param slugs - An array of tag slugs to fetch.
* @returns - A promise that resolves to an array of tags.
*/
>>>>>>> REPLACE
src/controllers/tag-controller.ts
<<<<<<< SEARCH
/**
* Creates a new tag.
* This method connects to the MongoDB database, inserts a new document into the 'tags' collection,
* and returns the newly created document.
* https://github.com/async
* @param {ICreateTag} tag - The tag to create.
* @returns {Promise<ITag>} - A promise that resolves to the newly created tag.
* @throws {Error} - Throws an error if there was an issue creating the tag.
*/
=======
/**
* Creates a new tag.
* This method connects to the MongoDB database, inserts a new document into the 'tags' collection,
* and returns the newly created document.
* https://github.com/async
* @param tag - The tag to create.
* @returns - A promise that resolves to the newly created tag.
* @throws - Throws an error if there was an issue creating the tag.
*/
>>>>>>> REPLACE
The Search and Replace blocks are not always perfect reflections of the actual changes that get committed to the Git repo. So it could be useful after the fact to go back and review what GPT asked to be changed as compared to what it was possible to automatically write into the commit.
I was thinking about what I would like this work like. What do you think of providing a commit template file to aider on startup? Something like --commit-template-file=/path/to/file. Im thinking we could define a syntax for this file for user provided details and aider provided details.
Just a thought but an example file could look like:
{user.prefix} {aider.commit_message}
{aider.chat_history}
Im thinking aider. tags are predefined and added to docs but user. tags are dynamic. Aider could parse this file on startup, identify any user. tags and request those values from the user before continuing.
Finally using the user provider values and the known aider values it can inject into the template to use as the commit message.
Any thoughts on this? Can it even work in the current structure?
I have implemented my idea and submitted a PR, let me know what you think @paul-gauthier
The latest version does not include the chat messages and diffs in the commit message.
The main branch doesn't add the "aider:" prefix. It now just adds an "(aider)" suffix to the author and committer name fields.
https://aider.chat/docs/git.html
I'm going to close this issue for now, but feel free to add a comment here and I will re-open or file a new issue any time.