From: Alban Gruin Date: Tue, 29 Jan 2019 15:01:48 +0000 (+0100) Subject: sequencer: introduce todo_list_write_to_file() X-Git-Tag: v2.22.0-rc0~74^2~13 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/616d7740cfbe65533af8ff1dabcf4e56f6baad5a?hp=616d7740cfbe65533af8ff1dabcf4e56f6baad5a sequencer: introduce todo_list_write_to_file() This introduces a new function to recreate the text of a todo list from its commands and write it to a file. This will be useful as the next few commits will change the use of the buffer in struct todo_list so it will no longer be a mirror of the file on disk. This functionality already exists in todo_list_transform(), but this function was made to replace the buffer of a todo list, which is not what we want here. Thus, the part of todo_list_transform() that replaces the buffer is dropped, and the function is renamed todo_list_to_strbuf(). It is called by todo_list_write_to_file() to fill the buffer to write to the disk. todo_list_write_to_file() can also take care of appending the help text to the buffer before writing it to the disk, or to write only the first n items of the list. This feature will be used by skip_unnecessary_picks(), which has to write done commands in a file. Signed-off-by: Alban Gruin Signed-off-by: Junio C Hamano ---