Re: [PATCH 15/22] sequencer: introduce a helper to read files written by scripts

2016-08-29 Thread Johannes Schindelin
Hi Dennis, On Mon, 29 Aug 2016, Dennis Kaarsemaker wrote: > On ma, 2016-08-29 at 10:06 +0200, Johannes Schindelin wrote: > > +   if (strbuf_read_file(buf, path, 0) < 0) { > > +   warning_errno("could not read '%s'", path); > > +   return 0; > > +   } > > + > > +   

Re: [PATCH 15/22] sequencer: introduce a helper to read files written by scripts

2016-08-29 Thread Dennis Kaarsemaker
On ma, 2016-08-29 at 10:06 +0200, Johannes Schindelin wrote: > +   if (strbuf_read_file(buf, path, 0) < 0) { > +   warning_errno("could not read '%s'", path); > +   return 0; > +   } > + > +   if (buf->len > orig_len && buf->buf[buf->len - 1] == '\n') { > +  

[PATCH 15/22] sequencer: introduce a helper to read files written by scripts

2016-08-29 Thread Johannes Schindelin
As we are slowly teaching the sequencer to perform the hard work for the interactive rebase, we need to read files that were written by shell scripts. These files typically contain a single line and are invariably ended by a line feed (and possibly a carriage return before that). Let's use a