Download raw body.
prevent log message loss during histedit
On December 12, 2020 12:56:37 PM MST, Stefan Sperling <stsp@stsp.name> wrote:
>On Fri, Dec 11, 2020 at 01:55:11AM +0100, Stefan Sperling wrote:
>> Off-list, jrick suggested to keep the behaviour intact where
>histedit's
>> commit operation is aborted if the saved log message is empty.
>
>This turned out to be a deeper rabbit hole than expected.
>
>There is a lot of fallout from allowing an empty log message to abort
>the histedit operation. I've written tests in an attempt to cover the
>expected behaviour, and it has now become clear that a lot more work
>is required in order to get this work properly.
>
>For now, I'd like to stick to the originally proposed change, and
>accept
>the fact that saving an empty log message won't abort the operation.
>
>All the rest can be revisted after the 0.45 release has been cut.
>
>ok?
>
>diff a2c1255649ab1b8d0fc66ec6ff07646b6176e764
>c10001dba47001c869fa9d1b8f1981b66c10cccc
>blob - 7bdd9e142a5f26254c73c308684bb6d6da95ef20
>blob + 997426c9255fb2e425f894acf4aa233d6fdb7722
>--- got/got.c
>+++ got/got.c
>@@ -8018,7 +8018,10 @@ histedit_edit_logmsg(struct
>got_histedit_list_entry *h
> if (err) {
> if (err->code != GOT_ERR_COMMIT_MSG_EMPTY)
> goto done;
>- err = got_object_commit_get_logmsg(&hle->logmsg, commit);
>+ err = NULL;
>+ hle->logmsg = strdup(new_msg);
>+ if (hle->logmsg == NULL)
>+ err = got_error_from_errno("strdup");
> }
> done:
> if (logmsg_path && unlink(logmsg_path) != 0 && err == NULL)
It can wait, of course.
--
Tracey Emery
Sent from my phone.
prevent log message loss during histedit