Skip to content

Conversation

ezyang
Copy link
Owner

@ezyang ezyang commented Jun 4, 2025

Stack from ghstack (oldest at bottom):

The implementation of append_metadata_to_message is a bit buggy and it is failing tests

FAILED tests/test_git_message.py::TestGitMessageHandling::test_append_to_message_with_trailing_newlines - AssertionError: 'feat: Add feature\n\nDescription\n\ncodemcp-id: abc-123\n\n' != 'feat: Add feature\n\nDescri...
FAILED tests/test_git_message.py::TestGitMessageHandling::test_append_to_message_with_double_trailing_newlines - AssertionError: 'feat: Add feature\n\nDescription\n\ncodemcp-id: abc-123\n\n\n' != 'feat: Add feature\n\nDesc...

Here is a better impl attached, please slot it in.

940b906  (Base revision)
a04e927  Add git_parse_message module with improved trailer parsing implementation
8ec84ca  Replace buggy append_metadata_to_message implementation with improved version
6249c20  Remove subprocess import from git_message.py since we're no longer using git interpret-trailers
513ae0f  Fix interpret_trailers to handle trailing newlines properly based on original message structure
4a9f30d  Fix trailer insertion logic to avoid adding extra newlines by using correct spacing
7e993e1  Rewrite interpret_trailers to follow the expected behavior from tests
927a645  Fix spacing for messages without body - they need single newline not double
7d00495  Fix empty message case to match expected format
f578782  Fix empty message case by handling it as a special case with correct spacing
HEAD     Skip the trailing newline logic for empty messages since we handle it specially

codemcp-id: 2-fix-replace-buggy-append-metadata-to-message-imple

[ghstack-poisoned]
@ezyang ezyang closed this in 7e41b1a Jun 4, 2025
dmerkert pushed a commit to dmerkert/codemcp that referenced this pull request Jun 4, 2025
The implementation of append_metadata_to_message is a bit buggy and it is failing tests

FAILED tests/test_git_message.py::**TestGitMessageHandling::test_append_to_message_with_trailing_newlines** - AssertionError: 'feat: Add feature\n\nDescription\n\ncodemcp-id: abc-123\n\n' != 'feat: Add feature\n\nDescri...
FAILED tests/test_git_message.py::**TestGitMessageHandling::test_append_to_message_with_double_trailing_newlines** - AssertionError: 'feat: Add feature\n\nDescription\n\ncodemcp-id: abc-123\n\n\n' != 'feat: Add feature\n\nDesc...

Here is a better impl attached, please slot it in.

```git-revs
940b906  (Base revision)
a04e927  Add git_parse_message module with improved trailer parsing implementation
8ec84ca  Replace buggy append_metadata_to_message implementation with improved version
6249c20  Remove subprocess import from git_message.py since we're no longer using git interpret-trailers
513ae0f  Fix interpret_trailers to handle trailing newlines properly based on original message structure
4a9f30d  Fix trailer insertion logic to avoid adding extra newlines by using correct spacing
7e993e1  Rewrite interpret_trailers to follow the expected behavior from tests
927a645  Fix spacing for messages without body - they need single newline not double
7d00495  Fix empty message case to match expected format
f578782  Fix empty message case by handling it as a special case with correct spacing
HEAD     Skip the trailing newline logic for empty messages since we handle it specially
```

codemcp-id: 2-fix-replace-buggy-append-metadata-to-message-imple
ghstack-source-id: e25b62e
Pull-Request-resolved: ezyang#308
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.

1 participant