Re: git clone of empty repositories doesn't preserve hash
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 26, 2023, 15:42 UTC
- Message-ID
- <xmqq8reeveee.fsf@gitster.g>
- In-Reply-To
- <20230426105134.GA130148@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
> We could send a capabilities^{} line, which Git has supported on the
> client side since eb398797cd (connect: advertized capability is not a
> ref, 2016-09-09). So sending it should not break even old clients
> (though we would have to check what alternate implementations like
> libgit2 or dulwich do; we know JGit supports it).Ah, I forgot all about that JGit workaround. Yes, we can exploit it, and any implementation that does not understand it correctly (including git before 13e67aa3 (v0 protocol: fix sha1/sha256 confusion for capabilities^{}, 2023-04-14)) does not work with JGit when cloning an empty repository anyway, so it is not all that bad.
But I tend to agree with your conclusion that it may be an update for the sake of completeness to retrofit v0/v1 on the serving side. It would not help any real-world use cases all that much.
Thanks.