CommitBERT: Commit Message Generation Using Pre-Trained Programming Language Model
Tae-Hwan Jung · 2021
In version control using Git, the commit message is a document that summarizes source code changes in natural language.A good commit message clearly shows the source code changes, so this enhances collaboration between developers.To write a good commit message, the message should briefly summarize the source code changes, which takes a lot of time and effort.Therefore, a lot of research has been studied to automatically generate a commit message when a code modification is given.However, in most of the studies so far, there was no curated dataset for code modifications (additions and deletions) and corresponding commit messages in various programming languages.The model also had difficulty learning the contextual representation between code modification and natural language.To solve these problems, we propose the following two methods: (1) We collect code modification and corresponding commit messages in Github for six languages (Python, PHP, Go, Java, JavaScript, and Ruby) and release a wellorganized 345K pair dataset.(2) In order to resolve the large gap in contextual representation between programming language (PL) and natural language (NL), we use CodeBERT (Feng et al., 2020), a pre-trained language model (PLM) for programming code, as an initial model.Using two methods leads to successful results in the commit message generation task.Also, this is the first research attempt in finetuning commit generation using various programming languages and code PLM.Training code, dataset, and pretrained weights are available at https://github.com/graykode/commit- autosuggestions.