Automated commit message generation with client side hooks

14 views
Skip to first unread message

Daniel Trierweiler

unread,
Oct 8, 2025, 3:32:49 PM (8 days ago) Oct 8
to TortoiseSVN
Hi!

We would like to use a LLM to automatically generate meaningful commit messages (similar to this post https://groups.google.com/g/tortoisesvn/c/1esea5tCqCY) and propose them to the user for the commit. For our specific use case, we want to allow the user to enter a ticket ID, so the LLM can use the information from the ticket to gather more context on the "why" of the change.

We found two different ways the process would work (for us), but both with flaws. We would like to ask if it would be possible to implement a solution for one (or both) of them.

1. We would prefer to use a "manual pre-commit" hook. This way, we can read the user input, extract information like a ticket id, and "refine" it. Problem is: The manual pre-commit hook has access to the commit message file, it isn't read back after executing the hook - so the loop is incomplete and not usable for this scenario.

2. As an alternative, we implemented a "start commit" hook, which works fine to pre-populate the commit message (it has the flaw that it doesn't know which files are checked, but it can generate something for all changed files). More annoyingly though (and I would assume this would affect other tools called in a start commit hook as well): The start commit hook is executed before SVN has created a window. This way, the focus is being passed from the Windows Explorer (or where the commit has been initiated from) to the dialog of the hook, back to the Windows Explorer, instead of to the commit window. 


Just from looking at the code, I would guess that it takes only one added line of code to change the behavior from the manual pre-commit hook (a call to m_cLogMessage.SetText(m_sLogMessage); after line 1980 in CommitDlg.cpp). 

Daniel

Stefan

unread,
Oct 11, 2025, 4:49:57 AM (6 days ago) Oct 11
to TortoiseSVN
I think in your case the best option would be to write a plugin that implements the IBugtraqProvider interface:
the "GetCommitMessage" function can do everything you need. The pathList param gives you all checked files, the originalMessage is the text the user has already entered and you can return a new message with the newMessage parameter.
Reply all
Reply to author
Forward
0 new messages