pretty: make it easier to add new formats
As the first step towards creating aliases, we make it easier to add new formats to the list of builtin formats. To do this, we move the initialization of the formats array into a new function, setup_commit_formats(), which we can easily extend later. Then, rather than looping through only the list of known formats, we make a more generic find_commit_format function, which will return the commit format whose name is the shortest which is prefixed with the passed-in sought format, the same rules which were more-or-less hard-coded in before. Signed-off-by: NWill Palmer <wmpalmer@gmail.com> Reviewed-by: NJonathan Nieder <jrnieder@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
Showing
想要评论请 注册 或 登录