Re: [PATCH v4 2/5] am: improve author-script error reporting

2018-11-04 Thread Junio C Hamano
Eric Sunshine writes: > Junio labeled the "-2" trick "cute", and while it is optimal in that > it only traverses the key/value list once, it also increases cognitive > load since the reader has to spend a good deal more brain cycles > understanding what is going on than would be the case with

Re: [PATCH v4 2/5] am: improve author-script error reporting

2018-11-03 Thread Eric Sunshine
On Wed, Oct 31, 2018 at 6:16 AM Phillip Wood wrote: > diff --git a/builtin/am.c b/builtin/am.c > @@ -308,6 +312,7 @@ static int read_author_script(struct am_state *state) > + int i, name_i = -2, email_i = -2, date_i = -2, err = 0; > @@ -326,14 +331,38 @@ static int read_author_script(struct

[PATCH v4 2/5] am: improve author-script error reporting

2018-10-31 Thread Phillip Wood
From: Phillip Wood If there are errors in a user edited author-script there was no indication of what was wrong. This commit adds some specific error messages depending on the problem. It also relaxes the requirement that the variables appear in a specific order in the file to match the behavior