git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "blanet via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,  Elijah Newren <newren@gmail.com>,
	 blanet <bupt_xingxin@163.com>,
	 Xing Xin <xingxin.xx@bytedance.com>
Subject: Re: [PATCH v2] diff-tree: fix crash when used with --remerge-diff
Date: Fri, 09 Aug 2024 08:46:08 -0700	[thread overview]
Message-ID: <xmqqy155em2n.fsf@gitster.g> (raw)
In-Reply-To: <xmqq5xs9g19w.fsf@gitster.g> (Junio C. Hamano's message of "Fri, 09 Aug 2024 08:32:27 -0700")

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".

> 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.


      reply	other threads:[~2024-08-09 15:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08 13:20 [PATCH] diff-tree: fix crash when used with --remerge-diff blanet via GitGitGadget
2024-08-08 16:03 ` Elijah Newren
2024-08-08 17:24   ` Junio C Hamano
2024-08-09  7:25   ` Xing Xin
2024-08-09  7:24 ` [PATCH v2] " blanet via GitGitGadget
2024-08-09 15:32   ` Junio C Hamano
2024-08-09 15:46     ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqy155em2n.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=bupt_xingxin@163.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=newren@gmail.com \
    --cc=xingxin.xx@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).