Re: [PATCH 2/4] sequencer: improve error message when an OID could not be parsed
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 14, 2019, 01:14 UTC
- Message-ID
- <xmqqef7acl5c.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <d8c4a3dde5bed492bcdb6399fd8a73ebf4798320.1552472189.git.gitgitgadget@gmail.com>
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 6 quoted lines
> From: Johannes Schindelin <johannes.schindelin@gmx.de> > > The interactive rebase simply complains about an "invalid line" when the > object hash of, say, a `pick` line could not be parsed. > > Let's tell the user what happened in a little more detail.
Makes sense.
Show 20 quoted lines
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> sequencer.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/sequencer.c b/sequencer.c
> index 95dda23eee..f91062718d 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -2137,7 +2137,8 @@ static int parse_insn_line(struct repository *r, struct todo_item *item,
> item->arg_len = (int)(eol - item->arg);
>
> if (status < 0)
> - return -1;
> + return error(_("could not parse '%.*s'"),
> + (int)(end_of_object_name - bol), bol);
>
> item->commit = lookup_commit_reference(r, &commit_oid);
> return !item->commit;