git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] merge-ort: fix calling merge_finalize() with no intermediate merge

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 20, 2023, 17:10 UTC
Message-ID
<xmqqa5z21nuq.fsf@gitster.g>
In-Reply-To
<d5c93b5b-32b9-ec50-1661-06f73fa37f5f@github.com>
Derrick Stolee <derrickstolee@github.com> writes:
Show 8 quoted lines
> On 4/20/2023 3:14 AM, Elijah Newren via GitGitGadget wrote:
>> From: Elijah Newren <newren@gmail.com>
>
>> While at it, ensure the FREE_AND_NULL() in the function does something
>> useful with the nulling aspect, namely sets result->priv to NULL rather
>> than a mere temporary.
>
> Good call. It also makes the code look better.
And more correct, if the NULLness of result->priv matters.
Show 9 quoted lines
> Perhaps this would be better as
>
> 	if (result->priv) {
> 		clear_or_reinit_internal_opts(result->priv, 0);
> 		FREE_AND_NULL(result->priv);
> 	}
>
> to avoid an accidental addition of code to the end of this
> method that doesn't depend on result->priv?
It does sound like a good idea.
Thanks.
Previous: Derrick StoleeNext: Elijah Newren
Message 3 of 7 in “merge-ort: fix calling merge_finalize() with no intermediate merge”
  1. merge-ort: fix calling merge_finalize() with no intermediate mergeElijah Newren via GitGitGadget, Apr 20, 2023
  2. Derrick StoleeApr 20, 2023
  3. Junio C HamanoApr 20, 2023
  4. Elijah NewrenApr 22, 2023
  5. Junio C HamanoApr 20, 2023
  6. merge-ort: fix calling merge_finalize() with no intermediate mergeElijah Newren via GitGitGadget, Apr 22, 2023
  7. Derrick StoleeApr 24, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.