Brevity is the Soul of Wit: Condensing Code Changes to Improve Commit Message Generation

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Kuang, Hongyu, Zhang, Ning, Gao, Hui, Zhou, Xin, Assunção, Wesley K. G., Ma, Xiaoxing, Shao, Dong, Rong, Guoping, Zhang, He
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866908546781675520
author Kuang, Hongyu
Zhang, Ning
Gao, Hui
Zhou, Xin
Assunção, Wesley K. G.
Ma, Xiaoxing
Shao, Dong
Rong, Guoping
Zhang, He
author_facet Kuang, Hongyu
Zhang, Ning
Gao, Hui
Zhou, Xin
Assunção, Wesley K. G.
Ma, Xiaoxing
Shao, Dong
Rong, Guoping
Zhang, He
contents Commit messages are valuable resources for describing why code changes are committed to repositories in version control systems (e.g., Git). They effectively help developers understand code changes and better perform software maintenance tasks. Unfortunately, developers often neglect to write high-quality commit messages in practice. Therefore, a growing body of work is proposed to generate commit messages automatically. These works all demonstrated that how to organize and represent code changes is vital in generating good commit messages, including the use of fine-grained graphs or embeddings to better represent code changes. In this study, we choose an alternative way to condense code changes before generation, i.e., proposing brief yet concise text templates consisting of the following three parts: (1) summarized code changes, (2) elicited comments, and (3) emphasized code identifiers. Specifically, we first condense code changes by using our proposed templates with the help of a heuristic-based tool named ChangeScribe, and then fine-tune CodeLlama-7B on the pairs of our proposed templates and corresponding commit messages. Our proposed templates better utilize pre-trained language models, while being naturally brief and readable to complement generated commit messages for developers. Our evaluation based on a widely used dataset showed that our approach can outperform six baselines in terms of BLEU-Norm, METEOR, and ROUGE-L, with average improvements of 51.7%, 78.7%, and 62.5%, respectively. The ablation study and human evaluation also provide further insights into the effectiveness of our approach.
format Preprint
id arxiv_https___arxiv_org_abs_2509_15567
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Brevity is the Soul of Wit: Condensing Code Changes to Improve Commit Message Generation
Kuang, Hongyu
Zhang, Ning
Gao, Hui
Zhou, Xin
Assunção, Wesley K. G.
Ma, Xiaoxing
Shao, Dong
Rong, Guoping
Zhang, He
Software Engineering
Commit messages are valuable resources for describing why code changes are committed to repositories in version control systems (e.g., Git). They effectively help developers understand code changes and better perform software maintenance tasks. Unfortunately, developers often neglect to write high-quality commit messages in practice. Therefore, a growing body of work is proposed to generate commit messages automatically. These works all demonstrated that how to organize and represent code changes is vital in generating good commit messages, including the use of fine-grained graphs or embeddings to better represent code changes. In this study, we choose an alternative way to condense code changes before generation, i.e., proposing brief yet concise text templates consisting of the following three parts: (1) summarized code changes, (2) elicited comments, and (3) emphasized code identifiers. Specifically, we first condense code changes by using our proposed templates with the help of a heuristic-based tool named ChangeScribe, and then fine-tune CodeLlama-7B on the pairs of our proposed templates and corresponding commit messages. Our proposed templates better utilize pre-trained language models, while being naturally brief and readable to complement generated commit messages for developers. Our evaluation based on a widely used dataset showed that our approach can outperform six baselines in terms of BLEU-Norm, METEOR, and ROUGE-L, with average improvements of 51.7%, 78.7%, and 62.5%, respectively. The ablation study and human evaluation also provide further insights into the effectiveness of our approach.
title Brevity is the Soul of Wit: Condensing Code Changes to Improve Commit Message Generation
topic Software Engineering
url https://arxiv.org/abs/2509.15567