Git commit doesn't show the actual commit message
Problem
When using the Bash tool with heredoc patterns like git commit -m "$(cat <<'EOF'...)", the tool only returns command success status and basic output, but doesn't echo back the actual content that was constructed via the heredoc. This creates a blind spot where users can't verify that:
- The heredoc content was formatted correctly
- Multi-line content was properly constructed
- Specific feedback or corrections were applied accurately
Example
Command:
git commit -m "$(cat <<'EOF'
feat: add user authentication system
- Implement JWT token handling
- Add login/logout endpoints
- Create user session management
- Fix password validation bug
🤖 Generated with Claude Code
EOF
)"
Current tool output:
[main abc1234] feat: add user authentication system
3 files changed, 45 insertions(+), 2 deletions(-)
Issue: There's no way to verify that the full multi-line commit message was actually written correctly, or that specific bullet points were included/excluded as intended.
Suggested Improvement
Show the full commit message content in the tool result, either:
- Echo back the complete message after successful commit
- Add an optional flag to display the message content
- Include the full message in the tool response alongside the
current file stats
Impact
This would help users:
- Verify commit message formatting is correct
- Confirm that feedback/corrections were properly applied
- Catch heredoc syntax issues before they become part of commit
history
- Build confidence in the git workflow automation
Workaround
Currently users need to run git log -1 --pretty=format:"%B" as a separate command to see what was actually committed.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗