Reapply multi-line git commit message support in auto-approve (attempt 2) #4044
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR reapplies the changes from PR #3104 that were reverted during the Roo v3.32.0 merge (PR #3895).
The Roo PR #9157 moved auto-approval logic from
ChatViewtoTask, and in the process, the command parsing was moved tosrc/shared/parse-command.ts. However, this new implementation doesn't preserve newlines within quoted strings, which breaks multi-line git commit messages.Problem
When using auto-approve with a multi-line git commit message like:
The command was being split on newlines, treating each line as a separate command, which caused the auto-approval to fail.
Solution
src/shared/quote-protection.tswithprotectNewlinesInQuotesfunction that temporarily replaces newlines inside quoted strings with placeholderssrc/shared/parse-command.tsto use quote protection before splitting by newlines, then restore the newlines after parsingTesting
Related PRs
ChatViewtoTaskRooCodeInc/Roo-Code#9157