Re: [PATCH v3 14/25] sequencer: introduce a helper to read files written by scripts

2016-10-20 Thread Johannes Schindelin
Hi Junio, On Tue, 18 Oct 2016, Junio C Hamano wrote: > Johannes Schindelin writes: > > > In the meantime, I'd be happy to just add a comment that this function is > > intended for oneliners, but that it will also read multi-line files and > > only strip off the EOL marker from the last line. >

Re: [PATCH v3 14/25] sequencer: introduce a helper to read files written by scripts

2016-10-18 Thread Junio C Hamano
Johannes Schindelin writes: > In the meantime, I'd be happy to just add a comment that this function is > intended for oneliners, but that it will also read multi-line files and > only strip off the EOL marker from the last line. > > Would that work for you? That would be ideal, I would think.

Re: [PATCH v3 14/25] sequencer: introduce a helper to read files written by scripts

2016-10-18 Thread Johannes Schindelin
Hi Junio, On Mon, 17 Oct 2016, Junio C Hamano wrote: > Johannes Schindelin writes: > > > +/* > > + * Reads a file that was presumably written by a shell script, i.e. > > + * with an end-of-line marker that needs to be stripped. > > + * > > + * Returns 1 if the file was read, 0 if it could not b

Re: [PATCH v3 14/25] sequencer: introduce a helper to read files written by scripts

2016-10-17 Thread Junio C Hamano
Johannes Schindelin writes: > +/* > + * Reads a file that was presumably written by a shell script, i.e. > + * with an end-of-line marker that needs to be stripped. > + * > + * Returns 1 if the file was read, 0 if it could not be read or does not > exist. > + */ > +static int read_oneliner(struc

[PATCH v3 14/25] sequencer: introduce a helper to read files written by scripts

2016-10-10 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 helpe