Re: [PATCH v2 21/25] sequencer: refactor write_message()

2016-10-05 Thread Johannes Schindelin
Hi Junio & Hannes, On Thu, 15 Sep 2016, Junio C Hamano wrote: > Johannes Sixt writes: > > > Am 11.09.2016 um 12:55 schrieb Johannes Schindelin: > >> -static int write_message(struct strbuf *msgbuf, const char *filename) > >> +static int write_with_lock_file(const char *filename, > >> +

Re: [PATCH v2 21/25] sequencer: refactor write_message()

2016-09-15 Thread Junio C Hamano
Johannes Sixt writes: > Am 11.09.2016 um 12:55 schrieb Johannes Schindelin: >> -static int write_message(struct strbuf *msgbuf, const char *filename) >> +static int write_with_lock_file(const char *filename, >> +const void *buf, size_t len, int append_eol) >> { >>

Re: [PATCH v2 21/25] sequencer: refactor write_message()

2016-09-12 Thread Johannes Sixt
Am 11.09.2016 um 12:55 schrieb Johannes Schindelin: -static int write_message(struct strbuf *msgbuf, const char *filename) +static int write_with_lock_file(const char *filename, + const void *buf, size_t len, int append_eol) { static struct lock_file msg_fil

Re: [PATCH v2 21/25] sequencer: refactor write_message()

2016-09-11 Thread Junio C Hamano
Johannes Schindelin writes: > The write_message() function safely writes an strbuf to a file. > Sometimes it is inconvenient to require an strbuf, though: the text to > be written may not be stored in a strbuf, or the strbuf should not be > released after writing. > > Let's refactor "safely writi

[PATCH v2 21/25] sequencer: refactor write_message()

2016-09-11 Thread Johannes Schindelin
The write_message() function safely writes an strbuf to a file. Sometimes it is inconvenient to require an strbuf, though: the text to be written may not be stored in a strbuf, or the strbuf should not be released after writing. Let's refactor "safely writing string to a file" into write_with_lock