From: Junio C Hamano Date: Fri, 26 Jun 2020 16:29:21 GMT Subject: Re: [PATCH v5 4/5] rebase -i: support --ignore-date Message-ID: In-Reply-To: <20200626095528.117524-5-phillip.wood123@gmail.com> Phillip Wood writes: > +/* Construct a free()able author string with current time as the author date */ > +static char *ignore_author_date(const char *author) > +{ > + int len = strlen(author); I'd rather not to see this initialization, because ... > + struct ident_split ident; > + struct strbuf new_author = STRBUF_INIT; > + > + if (split_ident_line(&ident, author, len) < 0) { ... it is away from this line. This line is better written if (split_ident_line(&ident, author, strlen(author)) < 0) { to show what the third parameter is about. It is not just "len", but is the length of the second parameter, author. > + error(_("malformed ident line '%s'"), author); > + return NULL; > + } > + > + len = ident.mail_end - ident.name_begin + 1; > + strbuf_addf(&new_author, "%.*s ", len, ident.name_begin); > + datestamp(&new_author); > + return strbuf_detach(&new_author, NULL); > +}