From: Junio C Hamano <gitster@pobox.com>
To: Neeraj Singh <nksingh85@gmail.com>
Cc: Neeraj Singh via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, "Neeraj K. Singh" <neerajsi@microsoft.com>
Subject: Re: [PATCH v2 1/2] tmp-objdir: new API for creating temporary writable databases
Date: Mon, 06 Dec 2021 09:39:21 -0800 [thread overview]
Message-ID: <xmqqr1aphbue.fsf@gitster.g> (raw)
In-Reply-To: <20211206085300.GA26699@neerajsi-x1.localdomain> (Neeraj Singh's message of "Mon, 6 Dec 2021 00:53:00 -0800")
Neeraj Singh <nksingh85@gmail.com> writes:
>> > + if (tmp_objdir)
>> > + tmp_objdir_reapply_primary_odb(tmp_objdir, old_cwd, new_cwd);
>> > free(path);
>> > }
>>
>> This is called during set_git_dir(), which happens fairly early in
>> the set-up sequence. I wonder if there is a real use case that
>> creates a tmp-objdir that early in the process to require this
>> unapply-reapply sequence.
>>
>
> The lack of this code was causing a failure, I believe in
> t2107-update-index-basic.sh: "--refresh triggers late setup_work_tree".
>
> This problem came up after applying: https://lore.kernel.org/git/4a40fd4a29a468b9ce320bc7b22f19e5a526fad6.1637020263.git.gitgitgadget@gmail.com/
>
> I thought it would be best to fix this in the tmp-objdir code so that
> callers could plug/unplug bulk checkin without any subtle surprises.
OK, I think that is fine.
As a slightly-related tangent that is outside the topic, I think we
should revisit "update-index", which is one of the oldest plumbing
commands with its own quirks. I do not offhand see why it needs to
sprinkle this many setup_work_tree() calls everywhere. Having an
index to work on means we must have a working tree to update and/or
refresh from. We should be able to get away with the NEED_WORK_TREE
bit in the git.c::commands[] table for this command. If this were a
more recent command, I may suspect that there were valid reasons
like "in this particular mode, update-index must work inside a bare
repository" to force us to take this unusual program structure, but
because this is probably a lot older than NEED_WORK_TREE bit, I
would not be surprised if the answer were "nobody noticed the
ugliness so far".
> Given that this patch series introduces functions with no users, are you
> going to hold off on putting this into 'next' until another next-worthy
> patch series is ready?
Even without any existing callers, as long as we see Reviewed-by: by
Elijah, who we know will have to build on top of this series, I
think this can and should go to 'next'.
Thanks.
next prev parent reply other threads:[~2021-12-06 17:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-04 2:40 [PATCH 0/2] ns/tmp-objdir: add support for temporary writable databases Neeraj K. Singh via GitGitGadget
2021-12-04 2:40 ` [PATCH 1/2] tmp-objdir: new API for creating " Neeraj Singh via GitGitGadget
2021-12-04 2:40 ` [PATCH 2/2] tmp-objdir: disable ref updates when replacing the primary odb Neeraj Singh via GitGitGadget
2021-12-05 18:23 ` Junio C Hamano
2021-12-05 23:44 ` Neeraj Singh
2021-12-05 23:56 ` Junio C Hamano
2021-12-06 3:10 ` Neeraj Singh
2021-12-06 0:36 ` [PATCH v2 0/2] ns/tmp-objdir: add support for temporary writable databases Neeraj K. Singh via GitGitGadget
2021-12-06 0:36 ` [PATCH v2 1/2] tmp-objdir: new API for creating " Neeraj Singh via GitGitGadget
2021-12-06 7:43 ` Junio C Hamano
2021-12-06 8:53 ` Neeraj Singh
2021-12-06 17:39 ` Junio C Hamano [this message]
2021-12-06 0:36 ` [PATCH v2 2/2] tmp-objdir: disable ref updates when replacing the primary odb Neeraj Singh via GitGitGadget
2021-12-06 3:12 ` Neeraj Singh
2021-12-06 22:05 ` [PATCH v3 0/2] ns/tmp-objdir: add support for temporary writable databases Neeraj K. Singh via GitGitGadget
2021-12-06 22:05 ` [PATCH v3 1/2] tmp-objdir: new API for creating " Neeraj Singh via GitGitGadget
2021-12-06 22:05 ` [PATCH v3 2/2] tmp-objdir: disable ref updates when replacing the primary odb Neeraj Singh via GitGitGadget
2021-12-08 16:41 ` [PATCH v3 0/2] ns/tmp-objdir: add support for temporary writable databases Elijah Newren
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=xmqqr1aphbue.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=neerajsi@microsoft.com \
--cc=nksingh85@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.