Subject: Re: [PATCH v3 02/15] xdiff: introduce rust

From: Junio C Hamano <[email-masked]>
Date: Wed, 03 Sep 2025 15:10:44 -0700

Patrick Steinhardt <[email-masked]> writes:

> I still think we need to be mindful around the community though. I
> understand that we want to have Rust in the codebase, and as I said I'm
> in favor of adopting it. But we also have a certain responsibility with
> Git given that it's used by almost every single developer out there.
>
> A compromise could be to ease into Rust: we adopt Rust, but before Git
> 3.0 it is entirely optional. So Git will continue to work alright even
> if there is no Rust compiler available. On the one hand this plays
> nicely with platforms that do not have Rust. On the other hand it also
> allows us to slowly iterate on the build infra for Rust, because I'm
> very sure that there's going to be issues there initially.
>
> With that we can:
>
>   - Build confidence in our Rust tooling.
>
>   - Figure out things as we go.
>
>   - Give distributions and other platforms enough time to prepare for
>     Rust becoming mandatory.
>
> I think adopting Rust as a mandatory dependency out of nowhere would not
> be playing nice. It may require significant effort from distros to adapt
> to the new reality, so we should give them time to do so.

Not just distros on exotic platforms, but also for users who cannot
afford to see regressions.  

> Note that I'm not saying that we need to have both a C and Rust
> implementation for everything written in Rust. I don't think that's
> sustainable in any way. But any feature written in Rust should be a
> _new_ feature that can be disabled and that users can live without for
> the time being.

Yes, if we can find such modular niche, it would be ideal.  But how
many areas that we can cleanly plug an optional thing in without
disrupting existing codebase are there?  Offhand, all I'd think of
are a new merge backend, a new rebase backend, a transport helper,
or perhaps a new diff-algorithm?

> It would be a shame, but right now it's a risky bet to build anything on
> top of Rust given that we don't officially accept it in Git yet. We need
> to first make the decision whether or not we want to have it right now,
> and if so how that's supposed to look like.

One more thing that I noticed.  What are our plans for the two
directories in contrib/libgit-{sys,rs}/?  IIRC, the new stuff from
Ezekiel did not interact with them at all, but it did not remove
them either, so I am a bit lost.

Thanks.