commit: use commit_list_append() instead of duplicating its code