Re: [PATCH 14/22] sequencer: prepare for rebase -i's commit functionality

2016-08-31 Thread Johannes Schindelin
Hi Junio, On Tue, 30 Aug 2016, Junio C Hamano wrote: > From: Junio C Hamano > Date: Tue, 30 Aug 2016 12:36:42 -0700 > Subject: [PATCH] am: refactor read_author_script() > > [...] Thank you so much for that! I will use that as a starting point to refactor the two

Re: [PATCH 14/22] sequencer: prepare for rebase -i's commit functionality

2016-08-30 Thread Junio C Hamano
Junio C Hamano writes: > Two functions with the same name reading from the same format, even > when they expect to produce the same result in different internal > format, without even being aware of each other is a bad enough > "regression" in maintainability of the code. One

Re: [PATCH 14/22] sequencer: prepare for rebase -i's commit functionality

2016-08-30 Thread Johannes Schindelin
Hi Junio, On Tue, 30 Aug 2016, Junio C Hamano wrote: > Johannes Schindelin writes: > > >> > +static char **read_author_script(void) > >> > +{ > >> > +struct strbuf script = STRBUF_INIT; > >> > +int i, count = 0; > >> > +char *p, *p2, **env; >

Re: [PATCH 14/22] sequencer: prepare for rebase -i's commit functionality

2016-08-30 Thread Junio C Hamano
Johannes Schindelin writes: >> > +static char **read_author_script(void) >> > +{ >> > + struct strbuf script = STRBUF_INIT; >> > + int i, count = 0; >> > + char *p, *p2, **env; >> > + size_t env_size; >> > + >> > + if (strbuf_read_file(,

Re: [PATCH 14/22] sequencer: prepare for rebase -i's commit functionality

2016-08-29 Thread Junio C Hamano
Johannes Schindelin writes: > +/* We will introduce the 'interactive rebase' mode later */ > +#define IS_REBASE_I() 0 I do not see a point in naming this all caps. The use site would be a lot more pleasant to read when the reader does not have to care if this is

[PATCH 14/22] sequencer: prepare for rebase -i's commit functionality

2016-08-29 Thread Johannes Schindelin
In interactive rebases, we commit a little bit differently than the sequencer did so far: we heed the "author-script", the "message" and the "amend" files in the .git/rebase-merge/ subdirectory. Likewise, we may want to edit the commit message *even* when providing a file containing the suggested