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

Re: [PATCH v2] diff-tree: fix crash when used with --remerge-diff

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 9, 2024, 15:46 UTC
Message-ID
<xmqqy155em2n.fsf@gitster.g>
In-Reply-To
<xmqq5xs9g19w.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
> but I have to wonder if we do even better in a future follow-up
> patch.
"if we do" -> "if we can do".
Show 7 quoted lines
> So wouldn't it work well if we
>
>  (1) at the beginning of do_remerge_diff(), only once for a rev_info
>      structure:
>    (1-a) lazily do the "object directory rotation"
>    (1-b) set up an atexit handler to clear the temporary object
>          store

An atexit handler may not be enough, when a program wants to start creating a real object after we did a remerge-diff but before exiting. So we'd probably need to allow an explicit "ok, we are done" clean-up call for such a program, too.

And the atexit handler can call the same clean-up function if the program hasn't called it explicitly. For logically read-only operations like diff-tree, they do not have to worry about rotating the real object store back to the primary status as soon as possible.

Previous: Junio C Hamano
Message 7 of 7 in “diff-tree: fix crash when used with --remerge-diff”
  1. diff-tree: fix crash when used with --remerge-diffblanet via GitGitGadget, Aug 8, 2024
  2. Elijah NewrenAug 8, 2024
  3. Junio C HamanoAug 8, 2024
  4. Xing XinAug 9, 2024
  5. diff-tree: fix crash when used with --remerge-diffblanet via GitGitGadget, Aug 9, 2024
  6. Junio C HamanoAug 9, 2024
  7. Junio C HamanoAug 9, 2024

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.