mbox series

[0/2] builtin/clone: allow remote helpers to detect repo

Message ID cover.1709041721.git.ps@pks.im (mailing list archive)
Headers show
Series builtin/clone: allow remote helpers to detect repo | expand

Message

Patrick Steinhardt Feb. 27, 2024, 2:27 p.m. UTC
Hi,

this patch series addresses a regression reported by Mike in Git v2.44
where remote helpers cannot access the Git repository anymore when
running git-clone(1).

The root cause of this is that we have started to initialize the refdb
at a later point, after the helper is spawned. This is required such
that we can initialize it with the correct object format, which fixes
clones of SHA256 repositories with the reftable format and when using
bundles.

The proposed fix here is to partially initialize the refdb with just
enough data such that it can be discovered. The fix isn't pretty, but
addresses the issue. I also couldn't come up with a better idea than
this.

Patrick

Patrick Steinhardt (2):
  refs/reftable: don't fail empty transactions in repo without HEAD
  builtin/clone: allow remote helpers to detect repo

 builtin/clone.c            | 46 ++++++++++++++++++++++++++++++++++++++
 refs/reftable-backend.c    |  1 +
 setup.c                    |  9 +++++++-
 t/t0610-reftable-basics.sh | 13 +++++++++++
 t/t5801/git-remote-testgit |  5 +++++
 5 files changed, 73 insertions(+), 1 deletion(-)


base-commit: a2082dbdd315aa4dd3f315545e5b3ab3b3e2d894

Comments

Junio C Hamano Feb. 27, 2024, 8:58 p.m. UTC | #1
Patrick Steinhardt <ps@pks.im> writes:

> Hi,
>
> this patch series addresses a regression reported by Mike in Git v2.44
> where remote helpers cannot access the Git repository anymore when
> running git-clone(1).
> ...
>  builtin/clone.c            | 46 ++++++++++++++++++++++++++++++++++++++
>  refs/reftable-backend.c    |  1 +

Sorry, but this confuses me.  Was a regression really in v2.44.0,
where refs/reftable-backend.c did not even exist?  If so why does a
fix for it need to touch that file?

Thanks.
Junio C Hamano Feb. 27, 2024, 9:33 p.m. UTC | #2
Junio C Hamano <gitster@pobox.com> writes:

> Patrick Steinhardt <ps@pks.im> writes:
>
>> Hi,
>>
>> this patch series addresses a regression reported by Mike in Git v2.44
>> where remote helpers cannot access the Git repository anymore when
>> running git-clone(1).
>> ...
>>  builtin/clone.c            | 46 ++++++++++++++++++++++++++++++++++++++
>>  refs/reftable-backend.c    |  1 +
>
> Sorry, but this confuses me.  Was a regression really in v2.44.0,
> where refs/reftable-backend.c did not even exist?  If so why does a
> fix for it need to touch that file?
>
> Thanks.

I guess [2/2] alone is the fix to be applied directly on top of v2.44.0
and eventually be merged to 'maint' to become v2.44.1 release, while
[1/2] is necessary to adjust reftable backend when such a fix is
merged to more recent codebase that already has the reftable
backend?
Patrick Steinhardt March 4, 2024, 6:44 a.m. UTC | #3
On Tue, Feb 27, 2024 at 01:33:55PM -0800, Junio C Hamano wrote:
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > Patrick Steinhardt <ps@pks.im> writes:
> >
> >> Hi,
> >>
> >> this patch series addresses a regression reported by Mike in Git v2.44
> >> where remote helpers cannot access the Git repository anymore when
> >> running git-clone(1).
> >> ...
> >>  builtin/clone.c            | 46 ++++++++++++++++++++++++++++++++++++++
> >>  refs/reftable-backend.c    |  1 +
> >
> > Sorry, but this confuses me.  Was a regression really in v2.44.0,
> > where refs/reftable-backend.c did not even exist?  If so why does a
> > fix for it need to touch that file?
> >
> > Thanks.
> 
> I guess [2/2] alone is the fix to be applied directly on top of v2.44.0
> and eventually be merged to 'maint' to become v2.44.1 release, while
> [1/2] is necessary to adjust reftable backend when such a fix is
> merged to more recent codebase that already has the reftable
> backend?

Yes, exactly! Sorry, should've explained this more thoroughly.

Patrick