Commit message generation improves using issue traceability reasoning

Beyond Similarity-Based Generation: Guiding Commit Message Generation with Issue-Commit Traceability

Software Engineering

Summary

Writing clear messages for code changes helps developers work together, but it can be time-consuming. The authors propose TraceMsg, a system that makes automated commit messages better by linking them to the issues the code changes fix. This connection helps the messages be more useful in real software work beyond just sounding similar to human-written ones. The system works by generating messages, checking how well they connect to issues, and improving them based on feedback. Tests on multiple projects show this method makes commit messages more accurate and helpful.

What this means in practice

  • For software development teams: Improve automatic commit messages to better reflect linked issues, helping teams understand code changes in large projects.
  • For software project managers: Use enhanced commit messages that support traceability to simplify tracking of issue progress and impact across releases.

Authors

Chunying Zhou, Gong Chen, Xiaoyuan Xie, Yi Song, Yuxuan Yang, Peng He

Abstract

Commit messages provide records of code changes and help developers understand and maintain software. To reduce the manual effort involved in writing them, commit message generation (CMG) approaches automatically generate commit messages that describe code changes in natural language. Existing CMG approaches generally treat CMG as a standalone task and optimize generated messages primarily for similarity to developer-written references. However, this objective may not properly reflect the practical usefulness of generated commit messages. This limitation matters in current AI-assisted software engineering workflows, where commit messages are used as shared information to serve different software engineering activities. To fill this gap, we propose TraceMsg, which uses issue-commit traceability, a representative software engineering activity, to guide commit message generation. TraceMsg is a collaborative multi-agent framework that coordinates message generation, traceability reasoning, and feedback-guided refinement, allowing generated messages to serve traceability while using reasoning feedback to guide issue-conditioned refinement. We evaluate TraceMsg on six open-source projects. The experimental results show that TraceMsg achieves an average Hit@1 of 0.893 and an MRR of 0.911, improving Hit@1 and MRR by 13.16% and 38.75%, respectively, over the best baseline for each metric.