Skip to contentSkip to conversation

RFC: Accelerate xdiff and begin its rustification

PATCH Superseded Ezekiel Newren via GitGitGadget 24 participants 204 messages Jul 17, 2025 – Nov 17, 2025 Page 2 of 2

Subsystems (4)
lore
Share & tools
lore
#128 lore raw

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

In reply to [email protected]
Quoted 10 lines · On Sat, Aug 23, 2025, at 15:43, [email protected] wrote:
Quoted 9 lines · Ezekiel Newren

From: Ezekiel Newren <[email protected]>

Upcoming patches will simplify xdiff, while also porting parts of it to Rust. In preparation, add some stubs and setup the Rust build. For now, it is easier to let cargo build rust and have make or meson merely link against the static library that cargo builds. In line with ongoing libification efforts, use multiple crates to allow more modularity on the Rust side. xdiff is the crate that this series will focus on, but we also introduce the interop crate for future patch series.

Quoted 8 lines
Quoted 5 lines

In order to facilitate interoperability between C and Rust, introduce C definitions for Rust primitive types in git-compat-util.h.

[snip snip]

Does this introduce Rust as a mandatory dependency for git? If so, it cuts out numerous platforms.

The proposed platform support policy is in patch 1.

https://lore.kernel.org/git/6d065f550fe871cf010409f7bd2a63438cf52723.1755921357.git.gitgitgadget@gmail.com/

#129 lore raw

RE: [PATCH v3 02/15] xdiff: introduce rust

In reply to Kristoffer Haugsbakk
Quoted 17 lines · Kristoffer Haugsbakk
Quoted 9 lines · On Sat, Aug 23, 2025, at 15:43, [email protected] wrote:
Quoted 8 lines · Ezekiel Newren

From: Ezekiel Newren <[email protected]>

Upcoming patches will simplify xdiff, while also porting parts of it
to Rust. In preparation, add some stubs and setup the Rust build. For now, it is easier to let cargo build rust and have make or meson
merely link against the static library that cargo builds. In line with ongoing libification efforts, use multiple crates to allow more modularity on the Rust side. xdiff is the crate that this series will focus on, but we

also introduce the interop crate for future patch series.

Quoted 6 lines
Quoted 5 lines

In order to facilitate interoperability between C and Rust, introduce C definitions for Rust primitive types in git-compat-util.h.

Quoted 7 lines
Quoted 2 lines

Does this introduce Rust as a mandatory dependency for git? If so, it cuts out numerous platforms.

The proposed platform support policy is in patch 1.

https://lore.kernel.org/git/6d065f550fe871cf010409f7bd2a63438cf52723.1755
[email protected]/

It is a very disappointing policy to be honest. It kicks me off git because Rust is not available on my platform, representing tens of thousands of users in North American alone. Rust is not available, but may be in a few years, but there is no guarantee that the hardware vendor (HPE) will provide support. I previously commented about the problem with Rust and was not taken seriously. This is disappointing and exclusionary.

The assertion in the policy that Rust is easily interoperable is incorrect.

Not Thanks,
Randall

#184 lore raw

Re: [PATCH v3 06/15] ivec: create a vector type that is interoperable between C and Rust

In reply to Ezekiel Newren via GitGitGadget

rust/xdiff/src/lib.rs line 1

Quoted 6 lines · Ezekiel Newren via GitGitGadget
rust/xdiff/src/lib.rs +1 -0
index e69de29bb2d1..8b137891791f 100644
@@ -0,0 +1 @@
+

This triggers an "new blank line at EOF" whitespace error while applying. Intended?

#185 lore raw

Re: [PATCH v3 06/15] ivec: create a vector type that is interoperable between C and Rust

Quoted 12 lines · Junio C Hamano

rust/xdiff/src/lib.rs line 1

Quoted 6 lines · Ezekiel Newren via GitGitGadget
rust/xdiff/src/lib.rs +1 -0
index e69de29bb2d1..8b137891791f 100644
@@ -0,0 +1 @@
+

This triggers an "new blank line at EOF" whitespace error while applying. Intended?

"new blank line at EOF" is intentional, but it is showing up in the wrong place in this patch series. Cargo format automatically creates a blank line for empty files. These warnings should have shown up on the "xdiff: introduce rust" commit. I will fix this.

#186 lore raw

Re: [PATCH v3 06/15] ivec: create a vector type that is interoperable between C and Rust

In reply to Ezekiel Newren via GitGitGadget
Quoted 5 lines · Ezekiel Newren via GitGitGadget

From: Ezekiel Newren <[email protected]>

Trying to use Rust's Vec in C, or git's ALLOC_GROW() macros (via wrapper functions) in Rust is painful because:

Quoted 10 lines

* C doing vector things the Rust way would require wrapper functions, and Rust doing vector things the C way would require wrapper
...
* Currently, Rust defines its own 'Vec' type that is generic, but its memory allocator and struct layout weren't designed for interoperability with C (or any language for that matter), meaning
...
* Similarly, git defines ALLOC_GROW() and related macros in git-compat-util.h. While we could add functions allowing Rust to
...

All the good reasons any C (or any non-Rust language for that matter) projects would want to have an interoperability Shim for their dynamically allocated and grown array-like things.

Quoted 3 lines

To address these issue, introduce a new type, ivec -- short for interoperable vector. (We refer to it as 'ivec' generally, though on the Rust side the struct is called IVec to match Rust style.)

I however was hoping by now Rust getting used more widely, somebody has already created a generic "this is how you make C-array and Rust vectors interoperate" wrapper that latecomer projects like us can use without inventing our own.

Makefile reconfigure config.mak.autogen: config.status · line 2754

Quoted 3 lines
Makefile +3 -0
+INTEROP_OBJS += interop/ivec.o
+.PHONY: interop-objs
+interop-objs: $(INTEROP_OBJS)

What is this phony target used for? No other targets seem to depend on this one (I am wondering if we need the latter two lines).

interop/ivec.c

Quoted 5 lines
interop/ivec.c new file +0 -0
new file mode 100644
index 000000000000..9bc2258c04ad

I am wondering if this needs a new hierarchy "interop"; shouldn't the existing "compat" be a good fit enough? I dunno.

Even though this is a shim to somebody else's code, it still is a part of our codebase, so our CodingGuidelines for C programs should apply.

interop/ivec.c line 4

Quoted 5 lines
interop/ivec.c new file +4 -0
@@ -0,0 +1,151 @@
+#include "ivec.h"
+
+static void ivec_set_capacity(void* self, usize new_capacity) {
+	struct rawivec *this = self;

- Asterisk sticks to the variable, not type.

- The opening and closing {braces} for the function body are written at the leftmost column on its own line.

- There should be a blank line between the declarations and the first statement.

Quoted 4 lines
interop/ivec.c new file +4 -0
+	if (new_capacity == 0)
+		FREE_AND_NULL(this->ptr);
+	else
+		this->ptr = xrealloc(this->ptr, new_capacity * this->element_size);

interop/ivec.c line 18

Quoted 10 lines
interop/ivec.c new file +10 -0
+	this->capacity = new_capacity;
+}
+
+void ivec_init(void* self, usize element_size) {
+	struct rawivec *this = self;
+	this->ptr = NULL;
+	this->length = 0;
+	this->capacity = 0;
+	this->element_size = element_size;
+}

I notice that this reintroduces a variable named "this", which was eradicated in 585c0e2e (diff: rename 'this' variables, 2018-02-14).

I do not think those who want to use C++ compilers on our C code would not mind "self", so how about doing something like...

	void ivec_init(void *self_, usize element_size)
	{
		struct rawivec *self = self;

		self->ptr = NULL;
		self->len = 0;
		self->capacity = 0;
		self->element_size = element_size;
	}

... perhaps?

interop/ivec.h line 4

Quoted 10 lines
interop/ivec.h new file +4 -0
new file mode 100644
index 000000000000..98be4bbeb54a
@@ -0,0 +1,52 @@
+#ifndef IVEC_H
+#define IVEC_H
+
+#include "../git-compat-util.h"

As we use -I. on the command line, there is no need to add "../" here; just writing

	#include <git-compat-util.h>

should be enough. Also, if this file does not depend on the services compat-util header provides (and I do not think it does from a brief look at its contents), it is better not to include it.

Instead, the sources (like ivec.c next door we just saw) should begin themselves with #include of git-compat-util.h header before including ivec.h.

rust/xdiff/src/lib.rs line 1

Quoted 6 lines
rust/xdiff/src/lib.rs +1 -0
index e69de29bb2d1..8b137891791f 100644
@@ -0,0 +1 @@
+

If this empty line in an otherwise empty file is absolutely necessary to make Rust work, then please arrange .gitattributes to tell git that this file is excempt from the usual blank-at-eof whitespace rule we use. If not, remove that unnecessary empty line.

Or perhaps remove the file altogether if nobody looks at it???

In any case, given that our top-level .gitattributes file starts with

* whitespace=!indent,trail,space *.[ch] whitespace=indent,trail,space diff=cpp *.sh whitespace=indent,trail,space text eol=lf
...
*.bat text eol=crlf
CODE_OF_CONDUCT.md -whitespace
...

I think a new rule to cover "*.rs" and perhaps *.toml files right before rules for each specific file begin would be in order.

Thanks.

#130 lore raw

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

In reply to [email protected]

Hi Randall,

Quoted 3 lines · On Sat, Aug 23, 2025 at 8:06 AM <[email protected]> wrote:
Quoted 1 line · Kristoffer Haugsbakk

On Sat, Aug 23, 2025, at 15:43, [email protected] wrote:

[...]

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

Does this introduce Rust as a mandatory dependency for git? If so, it cuts out numerous platforms.

The proposed platform support policy is in patch 1.

https://lore.kernel.org/git/6d065f550fe871cf010409f7bd2a63438cf52723.1755
[email protected]/

Quoted 6 lines

It is a very disappointing policy to be honest. It kicks me off git because Rust is not available on my platform, representing tens of thousands of users in North American alone. Rust is not available, but may be in a few years, but there is no guarantee that the hardware vendor (HPE) will provide support. I previously commented about the problem with Rust and was not taken seriously. This is disappointing and exclusionary.

I don't think that's fair. A quick reminder on the history: There was lots of excitement about potentially introducing Rust two years ago at our virtual Git contributors conference. Taylor formally proposed adopting it on the mailing list a year and a half ago. And at Git Merge last year, among those in attendance, there was broad significant interest in adopting Rust with unanimous support for letting it move forward among those that were present (which, yes, we know wasn't everyone). And there's the three rounds so far of this patch series. At every discussion where you weren't present, someone else would always bring up you and NonStop, and point out how you've been a very positive long-term member of the Git community and how Rust adoption would likely negatively affect you, which would be regrettable. We waited years to adopt Rust precisely (and I believe solely) because of your objections. Josh and Calvin even went the route of making optional not-even-built-by-default Rust libraries (libgit-rs and libgit-sys) when they wanted to add some Rust bindings. If years of deference by other community members isn't considered taking you seriously, I don't know what is.

I agree that it is disappointing that there isn't a clear way to both gain the compelling advantages of Rust while also retaining the full current extent of our widespread platform support. It's doubly unfortunate since you're such a positive contributing member of the community. But not allowing us to ever gain the advantages of Rust is problematic too. So, a decision has to be made, one way or the other.

If it helps, here's the statements I've seen from long term community members on Ezekiel's proposal for a hard dependency so far, most of
which call out the reduced platform support (whether in favor of the proposal or not):
* Randall: https://lore.kernel.org/git/[email protected]/
* brian: https://lore.kernel.org/git/[email protected]/
* Taylor: https://lore.kernel.org/git/[email protected]/
* Patrick: https://lore.kernel.org/git/[email protected]/
* Phillip: https://lore.kernel.org/git/[email protected]/

There's also been some emails that can be read as implicitly making a position statement on the topic from long term community members:
* Junio: https://lore.kernel.org/git/[email protected]/
* Johannes: https://lore.kernel.org/git/[email protected]/
* Elijah: https://lore.kernel.org/git/[email protected]/
(I figured my noted assistance of this series meant I didn't need to explicitly call out my support for it.)

Quoted 1 line

The assertion in the policy that Rust is easily interoperable is incorrect.

Are you mixing up interoperability with portability? Without further context than your email provides, it appears so to me. Rust code can call C code and vice-versa within the same process without huge amounts of serializing and deserializing of data structures, and without what amounts to something close to an operating system context switch in order to ensure call stacks are as expected for the language in question. To me, that means we can call the two languages easily interoperable. On the other hand, portability of those languages is about whether those languages have compilers supported on various hardware platforms. The document explicitly calls out that fewer systems have a Rust compiler than have a C compiler, and that Rust adoption would thus reduce how portable Git is. Are you referring to this lower portability that the document itself also calls out, or are you pointing out additional issues with interoperation between the languages on a platform where compilers for both languages exist? If the latter, could you provide more details?

I know my email is probably disappointing to you, at a minimum. I'm sorry about that. I hope it's helpful, at least in having links to where various folks in the community stand if nothing else.

#131 lore raw

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

Quoted 19 lines · Elijah Newren

I don't think that's fair. A quick reminder on the history: There was lots of excitement about potentially introducing Rust two years ago at our virtual Git contributors conference. Taylor formally proposed adopting it on the mailing list a year and a half ago. And at Git Merge last year, among those in attendance, there was broad significant interest in adopting Rust with unanimous support for letting it move forward among those that were present (which, yes, we know wasn't everyone). And there's the three rounds so far of this patch series. At every discussion where you weren't present, someone else would always bring up you and NonStop, and point out how you've been a very positive long-term member of the Git community and how Rust adoption would likely negatively affect you, which would be regrettable. We waited years to adopt Rust precisely (and I believe solely) because of your objections. Josh and Calvin even went the route of making optional not-even-built-by-default Rust libraries (libgit-rs and libgit-sys) when they wanted to add some Rust bindings. If years of deference by other community members isn't considered taking you seriously, I don't know what is.

Quoted 6 lines

I agree that it is disappointing that there isn't a clear way to both gain the compelling advantages of Rust while also retaining the full current extent of our widespread platform support. It's doubly unfortunate since you're such a positive contributing member of the community. But not allowing us to ever gain the advantages of Rust is problematic too. So, a decision has to be made, one way or the other.

I think it's worth saying that I do appreciate your (Randall's) positive contributions as well and I would love some way to continue to support NonStop as we adopt Rust. To be clear, I care deeply about portability:
I have owned PowerPC, UltraSPARC, MIPS, and ARM hardware, and I test many of my personal projects on at least Linux, FreeBSD, and NetBSD.

There is an alternative Rust compiler, mrustc[0], which is written in C++ and that I have played around with to see if it could meet our needs. I've been very busy lately and haven't had the time to test it out fully, and although it will likely require some upstream changes for static libraries and a compatibility wrapper because its minicargo is very limited in functionality, it might be an option that we could leverage. There will necessarily be work on Rust upstream as well, but I'm hoping that mrustc will at least open doors for us.

I also think that Rust is becoming a more and more common language in technology because of its interoperability with C and its memory safety. The support policy I wrote up explains why there is an increasing push from governments, security professionals, and the technology industry for memory-safe languages. If Git is to continue its success and broad adoption, we don't want it to be labelled software that is using security anti-patterns, and we also don't want it to be a CVE factory like libxml2 or ImageMagick. This is the reason I ultimately started work on the SHA-256 project many years ago: I knew we'd need to do it for security reasons and that without a more secure hash algorithm, Git would eventually be dropped.

My hope is that NonStop can find some way to support Rust because I think it's a compelling language and NonStop would greatly benefit from the wider variety of software available. My sense of previous discussions was that we do very much want NonStop to continue to come along as we support Rust in Git and that if there are ways we make it easier for both, we'd want to do that. That's certainly my view, at least.

[0] https://github.com/thepowersgang/mrustc

Signature · 2 lines
brian m. carlson (they/them)
Toronto, Ontario, CA
#132 lore raw

RE: [PATCH v3 02/15] xdiff: introduce rust

Quoted 52 lines · brian m. carlson
Quoted 19 lines · Elijah Newren

I don't think that's fair. A quick reminder on the history: There was lots of excitement about potentially introducing Rust two years ago at our virtual Git contributors conference. Taylor formally proposed adopting it on the mailing list a year and a half ago. And at Git Merge last year, among those in attendance, there was broad significant interest in adopting Rust with unanimous support for letting it move forward among those that were present (which, yes, we know wasn't everyone). And there's the three rounds so far of this patch series. At every discussion where you weren't present, someone else would always bring up you and NonStop, and point out how you've been a very positive long-term member of the Git community and how Rust adoption would likely negatively affect you, which would be regrettable. We waited years to adopt Rust precisely (and I believe solely) because of your objections. Josh and Calvin even went the route of making optional not-even-built-by-default Rust libraries (libgit-rs and libgit-sys) when they wanted to add some Rust bindings. If years of deference by other community members isn't considered taking you seriously, I don't know what is.

Quoted 6 lines

I agree that it is disappointing that there isn't a clear way to both gain the compelling advantages of Rust while also retaining the full current extent of our widespread platform support. It's doubly unfortunate since you're such a positive contributing member of the community. But not allowing us to ever gain the advantages of Rust is problematic too. So, a decision has to be made, one way or the other.

I think it's worth saying that I do appreciate your (Randall's) positive contributions as well and I would love some way to continue to support NonStop as we adopt Rust. To be clear, I care deeply about portability:
I have owned PowerPC, UltraSPARC, MIPS, and ARM hardware, and I test many of my personal projects on at least Linux, FreeBSD, and NetBSD.

There is an alternative Rust compiler, mrustc[0], which is written in C++ and that I have played around with to see if it could meet our needs. I've been very busy lately and haven't had the time to test it out fully, and although it will likely require some upstream changes for static libraries and a compatibility wrapper because its minicargo is very limited in functionality, it might be an option that we could leverage. There will necessarily be work on Rust upstream as well, but I'm hoping that mrustc will at least open doors for us.

I also think that Rust is becoming a more and more common language in technology because of its interoperability with C and its memory safety.
The support policy I wrote up explains why there is an increasing push from governments, security professionals, and the technology industry for memory-safe languages. If Git is to continue its success and broad adoption, we don't want it to be labelled software that is using security anti-patterns, and we also don't want it to be a CVE factory like libxml2 or ImageMagick. This is the reason I ultimately started work on the SHA-256 project many years ago: I knew we'd need to do it for security reasons and that without a more secure hash algorithm, Git would eventually be dropped.

Quoted 8 lines

My hope is that NonStop can find some way to support Rust because I think it's a compelling language and NonStop would greatly benefit from the wider variety of software available. My sense of previous discussions was that we do very much want NonStop to continue to come along as we support Rust in Git and that if there are ways we make it easier for both, we'd want to do that. That's certainly my view, at least.

[0] https://github.com/thepowersgang/mrustc

I appreciate the encouragement, Brian. I have been trying to port Rust (and GO) for years, without success on the platform. It is only POSIX, but not Linux, which seems to be the requirement to do almost anything anymore.

I gave mrustc a try before. It appears to require GCC, which does not port to NonStop. If you have any build recipes that work with c11, that would be helpful. We are Expecting c17 soon. I can run c11 in c++ mode, but the makefiles seem to require G++, which is part of GCC.

#187 lore raw

Re: [PATCH v3 06/15] ivec: create a vector type that is interoperable between C and Rust

In reply to Junio C Hamano
Quoted 8 lines · Junio C Hamano
Quoted 3 lines

To address these issue, introduce a new type, ivec -- short for interoperable vector. (We refer to it as 'ivec' generally, though on the Rust side the struct is called IVec to match Rust style.)

I however was hoping by now Rust getting used more widely, somebody has already created a generic "this is how you make C-array and Rust vectors interoperate" wrapper that latecomer projects like us can use without inventing our own.

I've looked for code that will do what Git needs, but as far as I know nothing can do everything that my ivec can.

Quoted 6 lines

Makefile reconfigure config.mak.autogen: config.status · line 2754

Quoted 3 lines
Makefile +3 -0
+INTEROP_OBJS += interop/ivec.o
+.PHONY: interop-objs
+interop-objs: $(INTEROP_OBJS)

What is this phony target used for? No other targets seem to depend on this one (I am wondering if we need the latter two lines).

You are correct. I will remove those lines.

Quoted 8 lines

interop/ivec.c

Quoted 5 lines
interop/ivec.c new file +0 -0
new file mode 100644
index 000000000000..9bc2258c04ad

I am wondering if this needs a new hierarchy "interop"; shouldn't the existing "compat" be a good fit enough? I dunno.

I had considered compat/, but I thought it didn’t fit. I thought it meant that the same API would exist everywhere, as opposed to “We speak different languages, but we’ve agreed on a translator or common protocol”. In particular, an example from ivec, a function on both the C and Rust sides:

void ivec_extend_from_slice(void *_self, void const *ptr, usize size); pub fn extend_from_slice(&mut self, slice: &[T]) where T: Clone,

The Rust side uses a slice or “fat” pointer, where the C side uses two arguments (a pointer and a size) in its place. The API is different, even if semantically they are the same and they are interoperable.

Was I reading too much into the meaning of compat/? Do folks object to using interop/?

Quoted 3 lines

Even though this is a shim to somebody else's code, it still is a part of our codebase, so our CodingGuidelines for C programs should apply.

Sorry I missed those. I will fix them up.

Quoted 8 lines

interop/ivec.c line 4

Quoted 5 lines
interop/ivec.c new file +4 -0
@@ -0,0 +1,151 @@
+#include "ivec.h"
+
+static void ivec_set_capacity(void* self, usize new_capacity) {
+     struct rawivec *this = self;

- Asterisk sticks to the variable, not type.

Quoted 5 lines

- The opening and closing {braces} for the function body are written at the leftmost column on its own line.

- There should be a blank line between the declarations and the first statement.

I will make those changes.

Quoted 32 lines
Quoted 4 lines
interop/ivec.c new file +4 -0
+     if (new_capacity == 0)
+             FREE_AND_NULL(this->ptr);
+     else
+             this->ptr = xrealloc(this->ptr, new_capacity * this->element_size);

interop/ivec.c line 18

Quoted 10 lines
interop/ivec.c new file +10 -0
+     this->capacity = new_capacity;
+}
+
+void ivec_init(void* self, usize element_size) {
+     struct rawivec *this = self;
+     this->ptr = NULL;
+     this->length = 0;
+     this->capacity = 0;
+     this->element_size = element_size;
+}

I notice that this reintroduces a variable named "this", which was eradicated in 585c0e2e (diff: rename 'this' variables, 2018-02-14).

I do not think those who want to use C++ compilers on our C code would not mind "self", so how about doing something like...

        void ivec_init(void *self_, usize element_size)
        {
                struct rawivec *self = self;

                self->ptr = NULL;
                self->len = 0;
                self->capacity = 0;
                self->element_size = element_size;
        }
Quoted 1 line

... perhaps?

That sounds good. I will make those changes.

Quoted 14 lines

interop/ivec.h line 4

Quoted 10 lines
interop/ivec.h new file +4 -0
new file mode 100644
index 000000000000..98be4bbeb54a
@@ -0,0 +1,52 @@
+#ifndef IVEC_H
+#define IVEC_H
+
+#include "../git-compat-util.h"

As we use -I. on the command line, there is no need to add "../" here; just writing

Quoted 5 lines
        #include <git-compat-util.h>

should be enough. Also, if this file does not depend on the services compat-util header provides (and I do not think it does from a brief look at its contents), it is better not to include it.

This file actually does depend on git-compat-util.h, particularly the Rust primitive definitions (e.g. usize, u64, etc...).

I'll use the include style you mentioned.

Quoted 25 lines

rust/xdiff/src/lib.rs line 1

Quoted 6 lines
rust/xdiff/src/lib.rs +1 -0
index e69de29bb2d1..8b137891791f 100644
@@ -0,0 +1 @@
+

If this empty line in an otherwise empty file is absolutely necessary to make Rust work, then please arrange .gitattributes to tell git that this file is excempt from the usual blank-at-eof whitespace rule we use. If not, remove that unnecessary empty line.

Or perhaps remove the file altogether if nobody looks at it???

In any case, given that our top-level .gitattributes file starts with

* whitespace=!indent,trail,space *.[ch] whitespace=indent,trail,space diff=cpp *.sh whitespace=indent,trail,space text eol=lf
...
*.bat text eol=crlf
CODE_OF_CONDUCT.md -whitespace
...

Quoted 2 lines

I think a new rule to cover "*.rs" and perhaps *.toml files right before rules for each specific file begin would be in order.

This is only a problem for empty files, and we only have empty .rs files to setup the basic Rust build in this commit. It's not a problem later in this series and shouldn't be a problem in the future. I will remove those blank lines from those commits.

#133 lore raw

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

In reply to brian m. carlson
Quoted 33 lines · brian m. carlson
Quoted 19 lines · Elijah Newren

I don't think that's fair. A quick reminder on the history: There was lots of excitement about potentially introducing Rust two years ago at our virtual Git contributors conference. Taylor formally proposed adopting it on the mailing list a year and a half ago. And at Git Merge last year, among those in attendance, there was broad significant interest in adopting Rust with unanimous support for letting it move forward among those that were present (which, yes, we know wasn't everyone). And there's the three rounds so far of this patch series. At every discussion where you weren't present, someone else would always bring up you and NonStop, and point out how you've been a very positive long-term member of the Git community and how Rust adoption would likely negatively affect you, which would be regrettable. We waited years to adopt Rust precisely (and I believe solely) because of your objections. Josh and Calvin even went the route of making optional not-even-built-by-default Rust libraries (libgit-rs and libgit-sys) when they wanted to add some Rust bindings. If years of deference by other community members isn't considered taking you seriously, I don't know what is.

Quoted 6 lines

I agree that it is disappointing that there isn't a clear way to both gain the compelling advantages of Rust while also retaining the full current extent of our widespread platform support. It's doubly unfortunate since you're such a positive contributing member of the community. But not allowing us to ever gain the advantages of Rust is problematic too. So, a decision has to be made, one way or the other.

I think it's worth saying that I do appreciate your (Randall's) positive contributions as well and I would love some way to continue to support NonStop as we adopt Rust. To be clear, I care deeply about portability:
I have owned PowerPC, UltraSPARC, MIPS, and ARM hardware, and I test many of my personal projects on at least Linux, FreeBSD, and NetBSD.

Quoted 3 lines

There is an alternative Rust compiler, mrustc[0], which is written in C++ and that I have played around with to see if it could meet our needs.

As far as I'm aware, mrustc is intended purely for having a bootstrap path to rustc, not to be a full blown Rust implementation.

We discussed the other options in this area in
https://lore.kernel.org/git/[email protected]/ and Patrick's reply.

I still think it's dubious to move to something where there's only one implementation (and an implementation that moves very fast) when currently we go to pains to support even incomplete C compilers! See the "test balloon" for 'bool'.

Quoted 1 line

[...]

sam

#134 lore raw

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

In reply to brian m. carlson

[2025-08-23 19:24:33+0000] brian m. carlson:

Quoted 62 lines · Elijah Newren
Quoted 19 lines

I don't think that's fair. A quick reminder on the history: There was lots of excitement about potentially introducing Rust two years ago at our virtual Git contributors conference. Taylor formally proposed adopting it on the mailing list a year and a half ago. And at Git Merge last year, among those in attendance, there was broad significant interest in adopting Rust with unanimous support for letting it move forward among those that were present (which, yes, we know wasn't everyone). And there's the three rounds so far of this patch series. At every discussion where you weren't present, someone else would always bring up you and NonStop, and point out how you've been a very positive long-term member of the Git community and how Rust adoption would likely negatively affect you, which would be regrettable. We waited years to adopt Rust precisely (and I believe solely) because of your objections. Josh and Calvin even went the route of making optional not-even-built-by-default Rust libraries (libgit-rs and libgit-sys) when they wanted to add some Rust bindings. If years of deference by other community members isn't considered taking you seriously, I don't know what is.

Quoted 6 lines

I agree that it is disappointing that there isn't a clear way to both gain the compelling advantages of Rust while also retaining the full current extent of our widespread platform support. It's doubly unfortunate since you're such a positive contributing member of the community. But not allowing us to ever gain the advantages of Rust is problematic too. So, a decision has to be made, one way or the other.

I think it's worth saying that I do appreciate your (Randall's) positive contributions as well and I would love some way to continue to support NonStop as we adopt Rust. To be clear, I care deeply about portability:
I have owned PowerPC, UltraSPARC, MIPS, and ARM hardware, and I test many of my personal projects on at least Linux, FreeBSD, and NetBSD.

There is an alternative Rust compiler, mrustc[0], which is written in C++ and that I have played around with to see if it could meet our needs. I've been very busy lately and haven't had the time to test it out fully, and although it will likely require some upstream changes for static libraries and a compatibility wrapper because its minicargo is very limited in functionality, it might be an option that we could leverage. There will necessarily be work on Rust upstream as well, but I'm hoping that mrustc will at least open doors for us.

I also think that Rust is becoming a more and more common language in technology because of its interoperability with C and its memory safety. The support policy I wrote up explains why there is an increasing push from governments, security professionals, and the technology industry for memory-safe languages. If Git is to continue its success and broad adoption, we don't want it to be labelled software that is using security anti-patterns, and we also don't want it to be a CVE factory like libxml2 or ImageMagick. This is the reason I ultimately started work on the SHA-256 project many years ago: I knew we'd need to do it for security reasons and that without a more secure hash algorithm, Git would eventually be dropped.

My hope is that NonStop can find some way to support Rust because I think it's a compelling language and NonStop would greatly benefit from the wider variety of software available. My sense of previous discussions was that we do very much want NonStop to continue to come along as we support Rust in Git and that if there are ways we make it easier for both, we'd want to do that. That's certainly my view, at least.

Quoted 4 lines

[0] https://github.com/thepowersgang/mrustc

Signature · 2 lines
brian m. carlson (they/them)
Toronto, Ontario, CA

Hello,

mrustc isn't really a alternative compiler, it only serves to bootstrap rustc+cargo from source code rather than binaries, you can't really use it to compile arbitrary Rust code.

You'd still need to port LLVM and rustc.

gccrs would more be the alternative compiler but it still seems to have a long road ahead of it: https://rust-gcc.github.io/

Best regards

#190 lore raw

Re: [PATCH v3 06/15] ivec: create a vector type that is interoperable between C and Rust

In reply to Ezekiel Newren via GitGitGadget
Quoted 22 lines · Ezekiel Newren via GitGitGadget

From: Ezekiel Newren <[email protected]>

Trying to use Rust's Vec in C, or git's ALLOC_GROW() macros (via wrapper functions) in Rust is painful because:

* C doing vector things the Rust way would require wrapper functions, and Rust doing vector things the C way would require wrapper functions, so ivec was created to ensure a consistent contract between the 2 languages for how to manipulate a vector.
* Currently, Rust defines its own 'Vec' type that is generic, but its memory allocator and struct layout weren't designed for interoperability with C (or any language for that matter), meaning that the C side cannot push to or expand a 'Vec' without defining wrapper functions in Rust that C can call. Without special care, the two languages might use different allocators (malloc/free on the C side, and possibly something else in Rust), which would make it difficult for a function in one language to free elements allocated by a call from a function in the other language.
* Similarly, git defines ALLOC_GROW() and related macros in

Quoted 8 lines

git-compat-util.h. While we could add functions allowing Rust to invoke something similar to those macros, passing three variables (pointer, length, allocated_size) instead of a single variable (vector) across the language boundary requires more cognitive overhead for readers to keep track of and makes it easier to make mistakes. Further, for low-level components that we want to eventually convert to pure Rust, such triplets would feel very out of place.

I’m mildly surprised Vec isn’t a good fit: isn’t it a pointer, length, capacity triple? But it sounds like the main issue is allocator interop… which I would also have thought was supported? At least the current version is documented as being generic against an Allocator, too.

Quoted 9 lines

To address these issue, introduce a new type, ivec -- short for interoperable vector. (We refer to it as 'ivec' generally, though on the Rust side the struct is called IVec to match Rust style.) This new type is specifically designed for FFI purposes, so that both languages handle the vector in the same way, though it could be used on either side independently. This type is designed such that it can easily be replaced by a standard Rust 'Vec' once interoperability is no longer a concern.

Am I reading the patch correctly that the ivec implementation is primarily C? I’m not familiar with too many FFI projects in Rust, but I might have hoped we could write parts in Rust to gain any benefits from that, too. Is that a fool’s errand I’m thinking of?

#119 lore raw
In reply to Elijah Newren
Quoted 16 lines · Elijah Newren
Quoted 9 lines · Ramsay Jones
Quoted 6 lines · Ezekiel Newren via GitGitGadget

Changes in this second round of this RFC:

* Now builds and passes tests on all platforms (example run:

   https://github.com/ezekielnewren/git/actions/runs/16974821401). Special
   thanks to Johannes Schindelin for patches to things for Windows and
   linux32.
Quoted 4 lines

Hmm, builds on *all* platforms may be a bit optimistic (it doesn't on cygwin, for instance), so I'm guessing you mean all platforms which have CI defined. Perhaps you could mention the platforms which you have tested on. :)

Quoted 5 lines

Ezekiel says this email didn't show up in his inbox (no idea why), but yes what was meant was all platforms where gitgitgadget CI runs. If you follow the github.com link in the text that you quoted, you can see all those platforms (various windows flavors, various osx builds, musl, sparse, static analysis, etc.).

I do have some patches sitting around for a long while already that implements CI via MSYS2 in different environments. It works with both MSYS and MinGW, where I think they are somewhat related to Cygwin? If it would prove useful I could maybe polish this patch series and send it upstream.

Patrick

#188 lore raw

Re: [PATCH v3 06/15] ivec: create a vector type that is interoperable between C and Rust

In reply to Junio C Hamano
Quoted 9 lines · Junio C Hamano

interop/ivec.c

Quoted 5 lines
interop/ivec.c new file +0 -0
new file mode 100644
index 000000000000..9bc2258c04ad

Even though this is a shim to somebody else's code, it still is a part of our codebase, so our CodingGuidelines for C programs should apply.

Sorry, I should have caught these in my preliminary review before he sent this off to the list. One question, though...

Quoted 14 lines

interop/ivec.h line 4

Quoted 10 lines
interop/ivec.h new file +4 -0
new file mode 100644
index 000000000000..98be4bbeb54a
@@ -0,0 +1,52 @@
+#ifndef IVEC_H
+#define IVEC_H
+
+#include "../git-compat-util.h"

As we use -I. on the command line, there is no need to add "../" here; just writing

Quoted 5 lines
        #include <git-compat-util.h>

should be enough. Also, if this file does not depend on the services compat-util header provides (and I do not think it does from a brief look at its contents), it is better not to include it.

Should this rather be

   #include "git-compat-util.h"

with quotes rather than angle brackets? In particular:

$ git grep include.*git-compat-util -- '*.[ch]' | wc -l
362
$ git grep include.*git-compat-util -- '*/*.[ch]' | wc -l
125

So, we have 362 includes of git-compat-util.h in our codebase, 125 from subdirectories. Of those:

$ git grep include.*git-compat-util -- '*.[ch]' | grep '"' | wc -l
361
$ git grep include.*git-compat-util -- '*.[ch]' | grep '<' | wc -l
1

Only one of these include statements uses angle brackets -- the compiler-tricks/not-constant.c file (which appears to be a temporary hack that we'll eventually delete). I had always assumed <> were for system includes and "" for project includes, but a quick Google search shows the actual situation is quite a bit murkier than I'd realized. Still, our current project practice appears to be double quotes; is that fine here or are you suggesting you'd like the current project practice to be changed?

#191 lore raw

Re: [PATCH v3 06/15] ivec: create a vector type that is interoperable between C and Rust

In reply to Ben Knoble
Quoted 1 line · Ben Knoble

I’m mildly surprised Vec isn’t a good fit: isn’t it a pointer, length, capacity triple? But it sounds like the main issue is allocator interop… which I would also have thought was supported? At least the current version is documented as being generic against an Allocator, too.

Conceptually yes, semantically and syntactically no. On top of Vec<T> not being defined with #[repr(C)] (which ensures field order, C ABI layout, padding, etc...) the struct definition for Vec isn't constant between Rust versions. I'd be open to suggestions for an alternative to my ivec type.

=== Rust version 1.61.0 ===
from: https://doc.rust-lang.org/1.61.0/src/alloc/vec/mod.rs.html#400
#[stable(feature = "rust1", since = "1.0.0")] #[cfg_attr(not(test), rustc_diagnostic_item = "Vec")] #[rustc_insignificant_dtor]
pub struct Vec<T, #[unstable(feature = "allocator_api", issue =

"32838")] A: Allocator = Global> {
    buf: RawVec<T, A>,
    len: usize,
}

from: https://doc.rust-lang.org/1.61.0/src/alloc/raw_vec.rs.html#52
#[allow(missing_debug_implementations)]

pub(crate) struct RawVec<T, A: Allocator = Global> {
    ptr: Unique<T>,
    cap: usize,
    alloc: A,
}

=== Rust version 1.89.0 ===
from: https://doc.rust-lang.org/1.89.0/src/alloc/vec/mod.rs.html#414
#[stable(feature = "rust1", since = "1.0.0")] #[rustc_diagnostic_item = "Vec"] #[rustc_insignificant_dtor]
pub struct Vec<T, #[unstable(feature = "allocator_api", issue =

"32838")] A: Allocator = Global> {
    buf: RawVec<T, A>,
    len: usize,
}

from: https://doc.rust-lang.org/1.89.0/src/alloc/raw_vec/mod.rs.html#74
#[allow(missing_debug_implementations)]
pub(crate) struct RawVec<T, A: Allocator = Global> {
inner: RawVecInner<A>,
_marker: PhantomData<T>,
}

from: https://doc.rust-lang.org/1.89.0/src/alloc/raw_vec/mod.rs.html#86
#[allow(missing_debug_implementations)]

struct RawVecInner<A: Allocator = Global> {
    ptr: Unique<u8>,
    /// Never used for ZSTs; it's `capacity()`'s responsibility to
return usize::MAX in that case.
    ///
    /// # Safety
    ///
    /// `cap` must be in the `0..=isize::MAX` range.
    cap: Cap,
    alloc: A,
}
Quoted 1 line

Am I reading the patch correctly that the ivec implementation is primarily C? I’m not familiar with too many FFI projects in Rust, but I might have hoped we could write parts in Rust to gain any benefits from that, too. Is that a fool’s errand I’m thinking of?

The ivec type is defined and implemented in C (interop/ivec.[ch]) and Rust (rust/interop/src/ivec.rs). When I started writing the ivec type I didn't know if the Git community would accept a hard dependency on Rust, so I made ivec usable in C without needing Rust.

#189 lore raw

Re: [PATCH v3 06/15] ivec: create a vector type that is interoperable between C and Rust

In reply to Elijah Newren
Quoted 7 lines · Elijah Newren
Quoted 7 lines
Quoted 1 line

+#include "../git-compat-util.h"

As we use -I. on the command line, there is no need to add "../" here; just writing

        #include <git-compat-util.h>
Quoted 7 lines
Quoted 3 lines

should be enough. Also, if this file does not depend on the services compat-util header provides (and I do not think it does from a brief look at its contents), it is better not to include it.

Should this rather be

   #include "git-compat-util.h"

I meant <>; when "" included header is not found, it falls back as if it were <> included, IIRC, so writing <> when you specify exactly where your headers are with -I. avoids such unnecessary fallback in theory, but as both <> and "" search for implementation-defined places, the distinction does not make much practical difference.

Quoted 3 lines

Still, our current project practice appears to be double quotes; is that fine here or are you suggesting you'd like the current project practice to be changed?

It would be nice if we could do so, but I do not think it is worth the patch churn.

#192 lore raw

Re: [PATCH v3 06/15] ivec: create a vector type that is interoperable between C and Rust

In reply to Ezekiel Newren
Quoted 9 lines · Ezekiel Newren
Quoted 1 line · Ben Knoble

I’m mildly surprised Vec isn’t a good fit: isn’t it a pointer, length, capacity triple? But it sounds like the main issue is allocator interop… which I would also have thought was supported? At least the current version is documented as being generic against an Allocator, too.

Conceptually yes, semantically and syntactically no. On top of Vec<T> not being defined with #[repr(C)] (which ensures field order, C ABI layout, padding, etc...) the struct definition for Vec isn't constant between Rust versions. I'd be open to suggestions for an alternative to my ivec type.

Ah, thanks—I had forgotten about the #[repr(C)] needs and changes. Makes sense.

Quoted 6 lines
Quoted 1 line

Am I reading the patch correctly that the ivec implementation is primarily C? I’m not familiar with too many FFI projects in Rust, but I might have hoped we could write parts in Rust to gain any benefits from that, too. Is that a fool’s errand I’m thinking of?

The ivec type is defined and implemented in C (interop/ivec.[ch]) and Rust (rust/interop/src/ivec.rs). When I started writing the ivec type I didn't know if the Git community would accept a hard dependency on Rust, so I made ivec usable in C without needing Rust.

Right—I saw both implementations, but it looked like C did most of the work, which was my main question. Re-reading, it looks like Rust does more work than I thought (with implementations of insert/push/etc.)

That said, I think it's sensible to leave the type useable from just C unless/until Rust becomes required (and then we can move things over).

Thanks!

Signature · 1 line
D. Ben Knoble
#193 lore raw

Re: [PATCH v3 06/15] ivec: create a vector type that is interoperable between C and Rust

Quoted 7 lines · D. Ben Knoble
Quoted 6 lines
Quoted 1 line

Am I reading the patch correctly that the ivec implementation is primarily C? I’m not familiar with too many FFI projects in Rust, but I might have hoped we could write parts in Rust to gain any benefits from that, too. Is that a fool’s errand I’m thinking of?

The ivec type is defined and implemented in C (interop/ivec.[ch]) and Rust (rust/interop/src/ivec.rs). When I started writing the ivec type I didn't know if the Git community would accept a hard dependency on Rust, so I made ivec usable in C without needing Rust.

Quoted 6 lines

Right—I saw both implementations, but it looked like C did most of the work, which was my main question. Re-reading, it looks like Rust does more work than I thought (with implementations of insert/push/etc.)

That said, I think it's sensible to leave the type useable from just C unless/until Rust becomes required (and then we can move things over).

I like your idea of implementation consolidation. I just don't know what that would look like yet.

It's not straightforward because C doesn't have generics. I'll use IVec as an example, but this applies to any generic type in Rust. For a function like push() in IVec<T> it will have N definitions if there are N IVec types. e.g. If your code uses IVec<u64>, IVec<u8>, IVec<i32> that would mean that pub fn push(&mut self) {} would compile to 3 functions. If you don't use #[no_mangle] you'd have to figure out the Rust compiler's exact behavior for function names when calling it from C, which isn't stable or easily predictable. If you do use #[no_mangle] then the Rust compiler can't generate a generic function for each type.

Another problem is that the functions in ivec mostly deal with resizing the memory rather than controlling access to memory for the C side. Even if the C side used Rust defined functions, that wouldn't solve memory access issues to the pointer on the C side. We could enforce access to each element by requiring C to call a Rust defined function for each element, but that sounds very painful and slow. ivec is meant to be used as a scaffolding type to help transition C to Rust.

Other projects that do use Rust's builtin Vec (or some other collection type) often Box it and write wrapper functions. This means that the C side sees an opaque void* instead of a transparent struct like ivec with ptr, length, capacity, and element_size.

I'm curious if the community has more design feedback, or suggestions for an alternative to my ivec type.

#194 lore raw

Re: [PATCH v3 06/15] ivec: create a vector type that is interoperable between C and Rust

Quoted 2 lines · Ezekiel Newren

I'm curious if the community has more design feedback, or suggestions for an alternative to my ivec type.

I think this is a fine approach. We used a similar Vec<u8>-like structure when porting a service from C to Rust at $DAYJOB, but we've also used the boxing approach to good success.

Ultimately, I think boxing is the right choice when we don't need access from C. For instance, if I were to convert the loose object mapping code to Rust, I would store the data as a pair of Box<HashMap<_, _>> and then attach them to struct repository as void *.

But it's less definitive when you need access from C. Because of the way we intimately mess with the internals of our data structures in this codebase, the ivec is probably the right choice here, so I'd keep that.

Signature · 2 lines
brian m. carlson (they/them)
Toronto, Ontario, CA
#135 lore raw

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

In reply to Elijah Newren
Quoted 18 lines · Elijah Newren
Quoted 1 line

The assertion in the policy that Rust is easily interoperable is incorrect.

Are you mixing up interoperability with portability? Without further context than your email provides, it appears so to me. Rust code can call C code and vice-versa within the same process without huge amounts of serializing and deserializing of data structures, and without what amounts to something close to an operating system context switch in order to ensure call stacks are as expected for the language in question. To me, that means we can call the two languages easily interoperable. On the other hand, portability of those languages is about whether those languages have compilers supported on various hardware platforms. The document explicitly calls out that fewer systems have a Rust compiler than have a C compiler, and that Rust adoption would thus reduce how portable Git is. Are you referring to this lower portability that the document itself also calls out, or are you pointing out additional issues with interoperation between the languages on a platform where compilers for both languages exist? If the latter, could you provide more details?

I think that this is the main point from my point of view. Yes, we are strictly worsening the project's portability by adding Rust as a non-optional build component. But it is *not* the case that two Git clients (one hypothetical one built with Rust components, one existing one without) can't work on the same Git repository, even including one on the same machine.

Forgetting Rust for a moment, I don't think it is a realistic goal to have support for all platforms that could possibly want to run Git. I would imagine that there are platforms today that cannot run the latest and greatest version of Git for just that reason. My hope is that whatever version(s) *are* compatible with those platforms are good enough to support the workflows that those users need.

So my personal feeling is that that (not having a 100% portable version of Git across all possible platforms) is OK. But of course that does raise the concern that security fixes will be more difficult to backport across a hypothetical version boundary where Rust is introduced.

To that end, I would note a couple of things:

- This assumes that the Rust code has the same security vulnerabilities as the C code that it replaces. I don't think that is a given whatsoever, and I would bet that emperically there are fewer such vulnerabilities on the Rust side than on the C one (in fact, that is one of the reasons that we are considering Rust in the first place; brian m. carlson explains this point quite well IMHO).

- If there *is* a security vulnerability in the Rust code that also presents a vulnerability on the corresponding C side, I would hope that the project's track record of generously backporting security fixes would suggest that we would do so in this case as well, despite crossing a language boundary.

On the other side of that coin, if there is a security vulnerability in an older version of Git that isn't present in a newer one (regardless of whether or not Rust is involved), I would imagine that that we would write security patches against an even earlier maint- branch and forward-port them up to the most recent vulnerable version.

So my impression is that the main contention here is a concern that worsening the portability will make it harder to push out security fixes in either direction. But I don't think that's necessarily the case. Even if it is, I would again hope that the track record of the folks on the git-security list would suggest that we'd do the right thing and not abandon users on older platforms the moment Rust is introduced into the codebase.

Thanks,
Taylor

#136 lore raw

RE: [PATCH v3 02/15] xdiff: introduce rust

Quoted 59 lines · Taylor Blau
Quoted 18 lines · Elijah Newren
Quoted 1 line

The assertion in the policy that Rust is easily interoperable is incorrect.

Are you mixing up interoperability with portability? Without further context than your email provides, it appears so to me. Rust code can call C code and vice-versa within the same process without huge amounts of serializing and deserializing of data structures, and without what amounts to something close to an operating system context switch in order to ensure call stacks are as expected for the language in question. To me, that means we can call the two languages easily interoperable. On the other hand, portability of those languages is about whether those languages have compilers supported on various hardware platforms. The document explicitly calls out that fewer systems have a Rust compiler than have a C compiler, and that Rust adoption would thus reduce how portable Git is. Are you referring to this lower portability that the document itself also calls out, or are you pointing out additional issues with interoperation between the languages on a platform where compilers for both languages exist? If the latter, could you provide more details?

I think that this is the main point from my point of view. Yes, we are strictly worsening the project's portability by adding Rust as a non-optional build component. But it is *not* the case that two Git clients (one hypothetical one built with Rust components, one existing one without) can't work on the same Git repository, even including one on the same machine.

Forgetting Rust for a moment, I don't think it is a realistic goal to have support for all platforms that could possibly want to run Git. I would imagine that there are platforms today that cannot run the latest and greatest version of Git for just that reason. My hope is that whatever version(s) *are* compatible with those platforms are good enough to support the workflows that those users need.

So my personal feeling is that that (not having a 100% portable version of Git across all possible platforms) is OK. But of course that does raise the concern that security fixes will be more difficult to backport across a hypothetical version boundary where Rust is introduced.

To that end, I would note a couple of things:

- This assumes that the Rust code has the same security vulnerabilities as the C code that it replaces. I don't think that is a given whatsoever, and I would bet that emperically there are fewer such vulnerabilities on the Rust side than on the C one (in fact, that is one of the reasons that we are considering Rust in the first place; brian m. carlson explains this point quite well IMHO).

- If there *is* a security vulnerability in the Rust code that also presents a vulnerability on the corresponding C side, I would hope that the project's track record of generously backporting security fixes would suggest that we would do so in this case as well, despite crossing a language boundary.

On the other side of that coin, if there is a security vulnerability in an older version of Git that isn't present in a newer one (regardless of whether or not Rust is involved), I would imagine that that we would write security patches against an even earlier maint- branch and forward-port them up to the most recent vulnerable version.

Quoted 6 lines

So my impression is that the main contention here is a concern that worsening the portability will make it harder to push out security fixes in either direction. But I don't think that's necessarily the case. Even if it is, I would again hope that the track record of the folks on the git-security list would suggest that we'd do the right thing and not abandon users on older platforms the moment Rust is introduced into the codebase.

This is indeed my concern and hope, Taylor, as the maintainer for a platform that is feeling abandoned. Please note that HPE NonStop is an actively maintained and vendor supported commercial platform based on x86_64 POSIX, just not a Linux/Windows machine.
Thank you.

#137 lore raw

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

Quoted 11 lines · <[email protected]> writes:
Quoted 6 lines

So my impression is that the main contention here is a concern that worsening the portability will make it harder to push out security fixes in either direction. But I don't think that's necessarily the case. Even if it is, I would again hope that the track record of the folks on the git-security list would suggest that we'd do the right thing and not abandon users on older platforms the moment Rust is introduced into the codebase.

This is indeed my concern and hope, Taylor, as the maintainer for a platform that is feeling abandoned. Please note that HPE NonStop is an actively maintained and vendor supported commercial platform based on x86_64 POSIX, just not a Linux/Windows machine.

Thanks for a friendly conversation, but I would have to say that Taylor's "we know we end up having to support both, and we will do so" is way underestimates the cost to do so. And I hope that an actively maintained and vendor supported commercial platform would bear the burden of the major part of that cost themselves, when it becomes necessary to do such a dual support.

Thanks.

#138 lore raw

RE: [PATCH v3 02/15] xdiff: introduce rust

Quoted 15 lines · Junio C Hamano
Quoted 6 lines · <[email protected]> writes:
Quoted 6 lines

So my impression is that the main contention here is a concern that worsening the portability will make it harder to push out security fixes in either direction. But I don't think that's necessarily the case. Even if it is, I would again hope that the track record of the folks on the git-security list would suggest that we'd do the right thing and not abandon users on older platforms the moment Rust is introduced

into the codebase.

Quoted 5 lines

This is indeed my concern and hope, Taylor, as the maintainer for a platform that is feeling abandoned. Please note that HPE NonStop is an actively maintained and vendor supported commercial platform based on x86_64 POSIX, just not a Linux/Windows machine.

Quoted 5 lines

Thanks for a friendly conversation, but I would have to say that Taylor's "we know we end up having to support both, and we will do so" is way underestimates the cost to do so. And I hope that an actively maintained and vendor supported commercial platform would bear the burden of the major part of that cost themselves, when it becomes necessary to do such a dual support.

If the platform provider had taken on git, that might be possible, but it is not the case. This will come down to my small team to try to cope with this situation - generally without any help from anyone else. I can do much, but this will likely come down to my doing all of the work after hours and on weekends with no other support, as has happened for the past decade.

#139 lore raw

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

In reply to Junio C Hamano
Quoted 9 lines · Junio C Hamano
Quoted 7 lines · <[email protected]> writes:
Quoted 6 lines

So my impression is that the main contention here is a concern that worsening the portability will make it harder to push out security fixes in either direction. But I don't think that's necessarily the case. Even if it is, I would again hope that the track record of the folks on the git-security list would suggest that we'd do the right thing and not abandon users on older platforms the moment Rust is introduced into the codebase.

Quoted 8 lines
Quoted 4 lines

This is indeed my concern and hope, Taylor, as the maintainer for a platform that is feeling abandoned. Please note that HPE NonStop is an actively maintained and vendor supported commercial platform based on x86_64 POSIX, just not a Linux/Windows machine.

Thanks for a friendly conversation, but I would have to say that Taylor's "we know we end up having to support both, and we will do so" is way underestimates the cost to do so.

I don't mean to imply that doing so would not be costly or require additional effort. I was trying to highlight that I believe we on the git-security list have demonstrated a track record of supporting quite old release tracks when new security releases are cut.

I don't mean to suggest whatsoever that adding Rust into the mix would somehow not have an effect on the costliness of maintaining support for older versions, just that I believe we have show ourselves to be up to the challenge.

(As an aside, I mentioned in my earlier email to Randall that I have a suspicion that Rust code will have fewer security issues than C code, and so the likelihood of needing to backport a security fix from Rust to C seems lower to me than having to simply patch old C code. Time will tell, I guess.)

Thanks,
Taylor

#140 lore raw

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

Quoted 5 lines · Taylor Blau

(As an aside, I mentioned in my earlier email to Randall that I have a suspicion that Rust code will have fewer security issues than C code, and so the likelihood of needing to backport a security fix from Rust to C seems lower to me than having to simply patch old C code. Time will tell, I guess.)

Just like back when scripted Porcelains were rewritten in C, in 5 years, when a lot of the existing C code is rewritten, who among us would care to backport or "simply patch" old C code?

This of course assumes that these platforms that lack Rust still lack Rust after 5 years, yet still matters to the users, and the vendor does not care to support Git themselves. Maybe one of these three conditions would change and make the problem go away ;-)

#141 lore raw

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

Quoted 8 lines · Junio C Hamano
Quoted 5 lines · Taylor Blau

(As an aside, I mentioned in my earlier email to Randall that I have a suspicion that Rust code will have fewer security issues than C code, and so the likelihood of needing to backport a security fix from Rust to C seems lower to me than having to simply patch old C code. Time will tell, I guess.)

Quoted 8 lines

Just like back when scripted Porcelains were rewritten in C, in 5 years, when a lot of the existing C code is rewritten, who among us would care to backport or "simply patch" old C code?

This of course assumes that these platforms that lack Rust still lack Rust after 5 years, yet still matters to the users, and the vendor does not care to support Git themselves. Maybe one of these three conditions would change and make the problem go away ;-)

It will definitely require additional maintenance by us. I think it's reasonable to say that platforms without Rust won't get new features anymore. But when it comes to security fixes or significant bugs I think it's less sensible to say that they're left on their own.

I proposed this in a separate branch of these threads, but we could counteract this by declaring the last major version before we introduce Rust as an LTS version that will receive both security and severe bug fixes going forward. Ideally, that LTS release would continue to be maintained until the gcc-rs backend is ready for prime time, which should alleviate a lot of the portability concerns.

As Pierre-Emmanuel menitoned in [1], the backend is likely to stabilize next year. One or two years of backports for that particular LTS version doesn't feel too bad. And if it does become more involved we can maybe also distribute the load and rely on maintainers of impacted platforms without Rust to help out with the backporting.

Also, all of this feels like a significant shift. I'm strongly in favor of adopting Rust in our codebase, but I think we should do so carefully. So we might take it extra carefully and say that Rust will become a mandatory dependency in Git 3.0, where the last release before Git 3.0 will become an LTS release.

Patrick

[1]: <[email protected]>

#142 lore raw

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

Quoted 23 lines · Patrick Steinhardt
Quoted 8 lines · Junio C Hamano
Quoted 5 lines · Taylor Blau

(As an aside, I mentioned in my earlier email to Randall that I have a suspicion that Rust code will have fewer security issues than C code, and so the likelihood of needing to backport a security fix from Rust to C seems lower to me than having to simply patch old C code. Time will tell, I guess.)

Quoted 8 lines

Just like back when scripted Porcelains were rewritten in C, in 5 years, when a lot of the existing C code is rewritten, who among us would care to backport or "simply patch" old C code?

This of course assumes that these platforms that lack Rust still lack Rust after 5 years, yet still matters to the users, and the vendor does not care to support Git themselves. Maybe one of these three conditions would change and make the problem go away ;-)

It will definitely require additional maintenance by us. I think it's reasonable to say that platforms without Rust won't get new features anymore. But when it comes to security fixes or significant bugs I think it's less sensible to say that they're left on their own.

Quoted 7 lines

I proposed this in a separate branch of these threads, but we could counteract this by declaring the last major version before we introduce Rust as an LTS version that will receive both security and severe bug fixes going forward. Ideally, that LTS release would continue to be maintained until the gcc-rs backend is ready for prime time, which should alleviate a lot of the portability concerns.

That would be enormously appreciated and make me happy if it is possible.

Quoted 5 lines

As Pierre-Emmanuel menitoned in [1], the backend is likely to stabilize next year. One or two years of backports for that particular LTS version doesn't feel too bad. And if it does become more involved we can maybe also distribute the load and rely on maintainers of impacted platforms without Rust to help out with the backporting.

I'd be open to that if we're still in the position of needing it by then.

Quoted 6 lines

Also, all of this feels like a significant shift. I'm strongly in favor of adopting Rust in our codebase, but I think we should do so carefully. So we might take it extra carefully and say that Rust will become a mandatory dependency in Git 3.0, where the last release before Git 3.0 will become an LTS release.

This is what I was hoping for :)

It should be considered a "breaking change" in a sense (the "compatibility profile" of git changed) and 3.0 would be fitting.

It would perhaps liberate git developers in feeling free to make other changes while adopting Rust as well if they see fit.

Quoted 4 lines

Patrick

[1]: <[email protected]>

sam

#143 lore raw

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

In reply to Patrick Steinhardt
Quoted 5 lines · Patrick Steinhardt

As Pierre-Emmanuel menitoned in [1], the backend is likely to stabilize next year. One or two years of backports for that particular LTS version doesn't feel too bad. And if it does become more involved we can maybe also distribute the load and rely on maintainers of impacted platforms without Rust to help out with the backporting.

I'm very much in favour of supporting gccrs when it's available, but I also want to say that it currently is targeting 1.49, which is much older than we want. It's also not necessarily going to be fully usable or bug free in that amount of time.

I also want to point out that it's important that the maintainers of affected platforms build the tooling necessary for their platforms to be supported. I'm not seeing ports of LLVM to those architectures or contributions to gccrs that would make those platforms easier to support.

Quoted 5 lines

Also, all of this feels like a significant shift. I'm strongly in favor of adopting Rust in our codebase, but I think we should do so carefully. So we might take it extra carefully and say that Rust will become a mandatory dependency in Git 3.0, where the last release before Git 3.0 will become an LTS release.

I'd prefer we not wait that long. I'm doing some work in building the new loose object mapping using Rust and it's much more efficient than writing it in C because we don't have to sort the data when we use a BTreeMap. The code is much simpler, shorter, and easier to write.

Nobody else is currently working on the interoperability code and we expressed that we ideally wanted it for Git 3.0. Being able to use Rust means I can write that code faster, with fewer errors (and hence less debugging time), and better tests. Otherwise, I'm afraid that it will take longer and we might not have it fully upstream for Git 3.0.

We also have this series right now, which we'd have to abandon if we're not going to support Rust right away. I'd like to retain Ezekiel as a contributor and incorporate Rust, and I think the best time to adopt Rust is now, not at Git 3.0.

Signature · 2 lines
brian m. carlson (they/them)
Toronto, Ontario, CA
#144 lore raw

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

Quoted 12 lines · brian m. carlson
Quoted 5 lines · Patrick Steinhardt

As Pierre-Emmanuel menitoned in [1], the backend is likely to stabilize next year. One or two years of backports for that particular LTS version doesn't feel too bad. And if it does become more involved we can maybe also distribute the load and rely on maintainers of impacted platforms without Rust to help out with the backporting.

I'm very much in favour of supporting gccrs when it's available, but I also want to say that it currently is targeting 1.49, which is much older than we want. It's also not necessarily going to be fully usable or bug free in that amount of time.

Quoted 5 lines

I also want to point out that it's important that the maintainers of affected platforms build the tooling necessary for their platforms to be supported. I'm not seeing ports of LLVM to those architectures or contributions to gccrs that would make those platforms easier to support.

This isn't accurate. gccrs doesn't need particular porting to arches: at least not yet, and if it does, it'll be very minor; any changes of this sort will be in crates themselves which would go upstream.

As for the libgccjit-based backend for rustc, see
https://github.com/rust-lang/rustc_codegen_gcc/issues/49,
https://github.com/rust-lang/rustc_codegen_gcc/issues/744, and
https://github.com/rust-lang/rustc_codegen_gcc/issues/742 for discussion and complications. But to say that nobody is doing it or working towards it is inaccurate.

Quoted 7 lines
Quoted 6 lines

Also, all of this feels like a significant shift. I'm strongly in favor of adopting Rust in our codebase, but I think we should do so carefully. So we might take it extra carefully and say that Rust will become a mandatory dependency in Git 3.0, where the last release before Git 3.0 will become an LTS release.

Quoted 5 lines

I'd prefer we not wait that long. I'm doing some work in building the new loose object mapping using Rust and it's much more efficient than writing it in C because we don't have to sort the data when we use a BTreeMap. The code is much simpler, shorter, and easier to write.

I still think adopting Rust is a compatibility break and a "breaking change". Again, keeping in mind that for adopting C99 features (!), the Git project used "test balloons" very very recently.

Quoted 10 lines

Nobody else is currently working on the interoperability code and we expressed that we ideally wanted it for Git 3.0. Being able to use Rust means I can write that code faster, with fewer errors (and hence less debugging time), and better tests. Otherwise, I'm afraid that it will take longer and we might not have it fully upstream for Git 3.0.

We also have this series right now, which we'd have to abandon if we're not going to support Rust right away. I'd like to retain Ezekiel as a contributor and incorporate Rust, and I think the best time to adopt Rust is now, not at Git 3.0.

I think there's going to be various issues that arise even on platforms that support Rust that would make it fitting for Git 3.0, at least for the first few releases that incorporate Rust. I'll note that the series isn't currently using Meson's Rust integration as QEMU is doing.

sam

#146 lore raw

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

In reply to brian m. carlson
Quoted 11 lines · brian m. carlson
Quoted 5 lines · Patrick Steinhardt

As Pierre-Emmanuel menitoned in [1], the backend is likely to stabilize next year. One or two years of backports for that particular LTS version doesn't feel too bad. And if it does become more involved we can maybe also distribute the load and rely on maintainers of impacted platforms without Rust to help out with the backporting.

I'm very much in favour of supporting gccrs when it's available, but I also want to say that it currently is targeting 1.49, which is much older than we want. It's also not necessarily going to be fully usable or bug free in that amount of time.

I cannot really say much about this. Overall I think that the rapid release cycles and rapid adoption by projects that one typically sees in Rust are an indicator to me that the whole ecosystem is not yet stable.

If I had the choice, I'd much rather adopt an ancient version of Rust if it means that more platforms can support it.

Quoted 5 lines

I also want to point out that it's important that the maintainers of affected platforms build the tooling necessary for their platforms to be supported. I'm not seeing ports of LLVM to those architectures or contributions to gccrs that would make those platforms easier to support.

The gccrs maintainers are actively working on that backend, and as far as I understand the main difference between LLVM and gccrs is that the latter doesn't have to be ported over to every single platform individually.

Quoted 10 lines
Quoted 5 lines

Also, all of this feels like a significant shift. I'm strongly in favor of adopting Rust in our codebase, but I think we should do so carefully. So we might take it extra carefully and say that Rust will become a mandatory dependency in Git 3.0, where the last release before Git 3.0 will become an LTS release.

I'd prefer we not wait that long. I'm doing some work in building the new loose object mapping using Rust and it's much more efficient than writing it in C because we don't have to sort the data when we use a BTreeMap. The code is much simpler, shorter, and easier to write.

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.

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.

Quoted 10 lines

Nobody else is currently working on the interoperability code and we expressed that we ideally wanted it for Git 3.0. Being able to use Rust means I can write that code faster, with fewer errors (and hence less debugging time), and better tests. Otherwise, I'm afraid that it will take longer and we might not have it fully upstream for Git 3.0.

We also have this series right now, which we'd have to abandon if we're not going to support Rust right away. I'd like to retain Ezekiel as a contributor and incorporate Rust, and I think the best time to adopt Rust is now, not at Git 3.0.

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.

Patrick

#147 lore raw

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

Quoted 2 lines · Patrick Steinhardt
Quoted 1 line · brian m. carlson

On 2025-09-02 at 11:16:19, Patrick Steinhardt wrote:

[snip]

Quoted 21 lines
Quoted 4 lines

I'd prefer we not wait that long. I'm doing some work in building the new loose object mapping using Rust and it's much more efficient than writing it in C because we don't have to sort the data when we use a BTreeMap. The code is much simpler, shorter, and easier to write.

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.

Quoted 8 lines

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

I agree with everything you say above. Thank you for saying it. ;)

It is somewhat unfortunate that 'xdiff' was chosen as an initial project for this, since a git without the ability to produce a diff is, well, practically useless!

[I don't have any objection to making the rust code optional in this case - it should be easily possible to have both C and rust xdiff code].

I have already stopped building git on cygwin, since rust is not currently available on cygwin (and I'm not aware of any effort to port it there - although LLVM v20+ was recently made available).

ATB,
Ramsay Jones

#145 lore raw

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

In reply to Sam James
Quoted 15 lines · Sam James

I still think adopting Rust is a compatibility break and a "breaking change". Again, keeping in mind that for adopting C99 features (!), the Git project used "test balloons" very very recently.

Quoted 10 lines

Nobody else is currently working on the interoperability code and we expressed that we ideally wanted it for Git 3.0. Being able to use Rust means I can write that code faster, with fewer errors (and hence less debugging time), and better tests. Otherwise, I'm afraid that it will take longer and we might not have it fully upstream for Git 3.0.

We also have this series right now, which we'd have to abandon if we're not going to support Rust right away. I'd like to retain Ezekiel as a contributor and incorporate Rust, and I think the best time to adopt Rust is now, not at Git 3.0.

Quoted 4 lines

I think there's going to be various issues that arise even on platforms that support Rust that would make it fitting for Git 3.0, at least for the first few releases that incorporate Rust. I'll note that the series isn't currently using Meson's Rust integration as QEMU is doing.

Just want to voice my agreement with Sam here.

It seems strange that we have a test balloon for compound literals, something that GCC has supported since before 2001 [1]. But at the same time require a platform to support Rust. If a platform has Rust support, it certainly has a compiler supporting compound literals.

Collin

[1] https://github.com/gcc-mirror/gcc/commit/cedd825f0f18088f7235f02136021bd63a2e12df

#148 lore raw

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

In reply to Patrick Steinhardt
Quoted 16 lines · Patrick Steinhardt

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.

Quoted 8 lines

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

Quoted 5 lines

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?

Quoted 4 lines

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.

#149 lore raw

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

Quoted 6 lines · Junio C Hamano

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.

I haven't followed this series closely, but I wouldn't expect it to interact with contrib/libgit-*, since those libraries are intended use by external projects.

That said, we at Google don't currently have plans on expanding libgit-*, since JJ has been able to meet its needs by shelling out to the Git CLI for cases where gitoxide is not sufficient. It's possible (probable??) that we might return to libgit-rs in the future, but nothing is on the radar right now.

When libgit-* was still under review, brian said[0] they were interested in building on it, but I don't know if that is still accurate. brian, any update on that?

[0] https://lore.kernel.org/git/[email protected]/

#153 lore raw

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

In reply to Patrick Steinhardt
Quoted 2 lines · Patrick Steinhardt

If I had the choice, I'd much rather adopt an ancient version of Rust if it means that more platforms can support it.

I think you may be assuming that gccrs targeting Rust 1.49 will magically make it work on more platforms than upstream Rust will. That's not the case.

gccrs targeting Rust 1.49 will use libstd (the standard library) and libcore (the library for freestanding implementations) from Rust 1.49 and that means it will only support those platforms that Rust 1.49 did. For instance, Rust added support for Apache NuttX relatively recently. Even if it has stellar support in GCC, it won't work with that version of gccrs because the underlying libraries don't support any of those platforms. The only thing you can target that you couldn't before are systems that use neither libstd nor libcore—which essentially means the Linux kernel. It's like using a glibc from 2009 and expecting to work on RISC-V—it simply won't[0].

If you need support for new platforms, that requires a much _newer_ version of Rust. Thus, to be able to use gccrs, porters need to use the existing gcc codegen backend and get that code in immediately so that when gccrs is out and supports Rust 1.91, the standard library will work with those platforms. The fastest way to getting platforms supported is to port LLVM and then add them to upstream Rust that way.

I know there has been much complaint about the six-week lifespan of Rust releases. I myself dislike that. But the situation is that LTS releases require extensive amounts of work and nobody has stepped up to do that or pay for it to be done. Without dedicated staffing, it's not going to happen. That also means that individual projects decide what versions of Rust they do and don't want to support.

We're already supporting the version in Debian stable for a year after the new release comes out, so we're already far behind what everyone else is doing. For comparison, Rust 1.48 is in Debian 11, so we'd be supporting an effectively five-year-old compiler instead of a three-year-old compiler.

Requiring Rust 1.49 instead of Rust 1.63 makes it harder to use tools like bindgen and cbindgen, which exist to automatically create types and functions in one language in the other. That, in turn, will hinder our ability to effectively write code that crosses the boundary and introduce hard-to-find bugs, since we'll have to do that work manually. My experience is that these kinds of bugs tend to actually show up more frequently on less common platforms, like big-endian systems, so we'll be worsening the platform experience for those systems.

For context, when we ported a core service from C to Rust at work, we used bindgen to generate C struct definitions, which made the process much easier and avoided random crashes. As a result, nobody noticed the fact that we ported it incrementally over a couple of years. If we hadn't used bindgen, we probably would have had lots of random segfaults due to failing to maintain compatibility between Rust and C definitions of the same structures, which users would not have appreciated and would not have helped our goal of making our software more reliable and easier to maintain.

Quoted 4 lines

The gccrs maintainers are actively working on that backend, and as far as I understand the main difference between LLVM and gccrs is that the latter doesn't have to be ported over to every single platform individually.

I don't think that's the case. gccrs has to be compiled for every platform just like LLVM does. LLVM is actually easier to support because it can cross-compile from any platform to any platform without recompilation. For instance, I can target riscv64gc-unknown-openbsd on my Debian amd64 laptop assuming I can provide the necessary libraries for OpenBSD when compiling, but GCC requires me to specifically compile a compiler for that platform.

In any event, any portability changes will also likely need to go into libstd and libcore, which is used identically with both compilers.

It is, however, the case that GCC supports more architectures (and possibly more architecture/OS combinations) than LLVM. For instance, DEC Alpha and IA64 are only supported by GCC at the moment.

Quoted 3 lines

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.

We've actually had this discussion on the list several times where we've proposed the inclusion of Rust. This is not the first time it's come up, or the second. It was explicitly mentioned a year ago on the list that we wanted to adopt Rust in the notes from the Contributor Summit.

There has been plenty of notice that this is coming down the line. It's not accurate to claim it's "out of nowhere" nor to claim that people have not had plenty of time to port their systems.

Distros and porters should not be insensible to the increasing use of Rust or the need for them to get their systems working. For instance, you cannot run a GNOME or MATE desktop environment without librsvg2, which is written in Rust. Python's cryptography package adopted Rust over four years ago and there was the same gnashing of teeth[1], yet little progress has been made by porters on the same affected architectures since that time. In that time, Debian has bootstrapped and released an entire RISC-V port, complete with Rust.

I want to be clear I'm not opposed to supporting less common operating systems or architectures. For many years, my laptop was a PowerPC Mac, and I've owned UltraSPARC, MIPS, and ARM hardware. For personal code, I try to test it in CI on at least Linux, macOS, FreeBSD, and NetBSD. But also, when a Debian package has not worked properly on PowerPC or UltraSPARC, I've stepped up and fixed it. My requests to other projects when porting have been things like asking to write valid C or C++ (by not making unaligned accesses or avoiding endianness assumptions, for instance) and not to refrain from adding new languages or features.

It should be stated that there is a very easy way to get Rust working, and that's to port LLVM to the platform in question. IA-64 was removed in 2009, but it might be possible to resurrect that out of tree if there's interest and maybe even get it re-accepted upstream. I'll point out that AIX, Solaris, and QNX have done the necessary porting work to get LLVM and Rust working over the past couple years, so it's not out of the question for other platforms to do so as well. And, for the avoidance of doubt, I would be absolutely delighted if we were able to support additional platforms with Rust as well.

Also, the approach of making it an optional component directly contradicts the proposed policy I wrote up. That's a recipe for additional burdensome work maintaining two implementations, when we actually want to make it easier for people to contribute functionality. It also doesn't provide any of the memory safety benefits or address any of the concerns from governments, security professionals, and other parties about the real and substantial risks of continuing to develop in C.

For example, there is zero chance I will implement any of the SHA-1/SHA-256 compatibility code twice. I'm already doing that in my free time without any compensation at all and it's unreasonable to expect me to do it twice or even to #ifdef out all the places it would need to go. I am happy to let someone else take responsibility for the project instead, however, if they would like to do those things.

Quoted 4 lines

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.

I think we had made the decision at the 2024 Contributor's Summit that we wanted to adopt Rust in Git, so it was more of a matter of sending the patches than actually making that decision. As I recall, the decision was unanimous.

[0] RISC-V was developed in 2010.
[1] https://www.reddit.com/r/rust/comments/lfysy9/pythons_cryptography_package_introduced_build/

Signature · 2 lines
brian m. carlson (they/them)
Toronto, Ontario, CA
#150 lore raw

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

In reply to Junio C Hamano
Quoted 7 lines · Junio C Hamano
Quoted 5 lines · Patrick Steinhardt

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.

Quoted 5 lines

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?

Not too many, I guess.

If we cannot find anything, an alternative could also be to take a very simple subsystem that doesn't see a lot of changes and convert that to Rust. We'd retain both implementations in that case, which I mentioned is painful because we now have to keep both in sync. But if we say that this is a testballoon, only, and that we don't continue to convert other code until Git 3.0, then that might be fine.

"varint.c" could be a good match. It's trivial, only 30 lines of code, and completely standalone.

We could still build new and optional functionality via Rust, but I guess it also doesn't hurt to have a test balloon that is part of libgit.a to test interoperability.

I'll send patches later today.

Patrick

#154 lore raw

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

In reply to brian m. carlson
Quoted 7 lines · brian m. carlson
Quoted 2 lines · Patrick Steinhardt

If I had the choice, I'd much rather adopt an ancient version of Rust if it means that more platforms can support it.

I think you may be assuming that gccrs targeting Rust 1.49 will magically make it work on more platforms than upstream Rust will. That's not the case.

I don't have enough context to be able to tell. I'm mostly going by what the gccrs maintainers themselves are saying. But if I'm misunderstanding what gccrs will bring to the table I'm happy to be corrected.

[snip]

Quoted 13 lines
Quoted 3 lines

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.

We've actually had this discussion on the list several times where we've proposed the inclusion of Rust. This is not the first time it's come up, or the second. It was explicitly mentioned a year ago on the list that we wanted to adopt Rust in the notes from the Contributor Summit.

There has been plenty of notice that this is coming down the line. It's not accurate to claim it's "out of nowhere" nor to claim that people have not had plenty of time to port their systems.

Quoted 8 lines

Distros and porters should not be insensible to the increasing use of Rust or the need for them to get their systems working. For instance, you cannot run a GNOME or MATE desktop environment without librsvg2, which is written in Rust. Python's cryptography package adopted Rust over four years ago and there was the same gnashing of teeth[1], yet little progress has been made by porters on the same affected architectures since that time. In that time, Debian has bootstrapped and released an entire RISC-V port, complete with Rust.

Discussions of theoretical nature are one thing though. The transition that is actually happening is a different thing, and distributions will need to prepare for this. We already had multiple distro maintainers coming into these discussions saying that this will require a bunch of work, which should be an indicator to us that we need to take it slow. We should accommodate for that.

[snip]

Quoted 9 lines

It should be stated that there is a very easy way to get Rust working, and that's to port LLVM to the platform in question. IA-64 was removed in 2009, but it might be possible to resurrect that out of tree if there's interest and maybe even get it re-accepted upstream. I'll point out that AIX, Solaris, and QNX have done the necessary porting work to get LLVM and Rust working over the past couple years, so it's not out of the question for other platforms to do so as well. And, for the avoidance of doubt, I would be absolutely delighted if we were able to support additional platforms with Rust as well.

I cannot really say how hard or easy it is to port LLVM to a different platform. I'd be surprised though if that work really was that easy.

Quoted 8 lines

Also, the approach of making it an optional component directly contradicts the proposed policy I wrote up. That's a recipe for additional burdensome work maintaining two implementations, when we actually want to make it easier for people to contribute functionality. It also doesn't provide any of the memory safety benefits or address any of the concerns from governments, security professionals, and other parties about the real and substantial risks of continuing to develop in C.

The only reason why we want to have it as an optional component is to make the transitioning period easier for downstream distributors. And the intent is not to convert major components -- it should be trivial components that we can use as test balloons, similar to how we did it for all of our C99 test balloons.

We cannot just pull the rug away under their feet without advance notice that this is going to happen.

Quoted 6 lines

For example, there is zero chance I will implement any of the SHA-1/SHA-256 compatibility code twice. I'm already doing that in my free time without any compensation at all and it's unreasonable to expect me to do it twice or even to #ifdef out all the places it would need to go. I am happy to let someone else take responsibility for the project instead, however, if they would like to do those things.

And that's totally fair. From my point of view, this compatibility code is a _new_ feature that we are adding to Git. And as I mentioned, I think it is reasonable to say that new features may be implemented in Rust now already, as platforms that aren't yet ready wouldn't lose any existing functionality.

Quoted 9 lines
Quoted 4 lines

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.

I think we had made the decision at the 2024 Contributor's Summit that we wanted to adopt Rust in Git, so it was more of a matter of sending the patches than actually making that decision. As I recall, the decision was unanimous.

I think most or even all of the contributors are on board. But we never really talked about timelines, or how we want to introduce Rust, so that's a discussion we need to have now.

Patrick

#155 lore raw

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

Quoted 5 lines · Patrick Steinhardt
Quoted 4 lines · brian m. carlson
Quoted 2 lines · Patrick Steinhardt

If I had the choice, I'd much rather adopt an ancient version of Rust if it means that more platforms can support it.

Quoted 8 lines
Quoted 3 lines

I think you may be assuming that gccrs targeting Rust 1.49 will magically make it work on more platforms than upstream Rust will. That's not the case.

I don't have enough context to be able to tell. I'm mostly going by what the gccrs maintainers themselves are saying. But if I'm misunderstanding what gccrs will bring to the table I'm happy to be corrected.

(I also think it's obvious that once gccrs can handle 1.49, we will have to put effort into making things build with it. Not sure who wanted or claimed magic. I just think relyling on a single implementation isn't a good idea.)

Quoted 23 lines

[snip]

Quoted 13 lines
Quoted 3 lines

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.

We've actually had this discussion on the list several times where we've proposed the inclusion of Rust. This is not the first time it's come up, or the second. It was explicitly mentioned a year ago on the list that we wanted to adopt Rust in the notes from the Contributor Summit.

There has been plenty of notice that this is coming down the line. It's not accurate to claim it's "out of nowhere" nor to claim that people have not had plenty of time to port their systems.

Quoted 8 lines

Distros and porters should not be insensible to the increasing use of Rust or the need for them to get their systems working. For instance, you cannot run a GNOME or MATE desktop environment without librsvg2, which is written in Rust. Python's cryptography package adopted Rust over four years ago and there was the same gnashing of teeth[1], yet little progress has been made by porters on the same affected architectures since that time. In that time, Debian has bootstrapped and released an entire RISC-V port, complete with Rust.

Quoted 6 lines

Discussions of theoretical nature are one thing though. The transition that is actually happening is a different thing, and distributions will need to prepare for this. We already had multiple distro maintainers coming into these discussions saying that this will require a bunch of work, which should be an indicator to us that we need to take it slow. We should accommodate for that.

I imagine most distributions have absolutely zero awareness of this thread or plans for git. See below.

Quoted 12 lines

[snip]

Quoted 9 lines

It should be stated that there is a very easy way to get Rust working, and that's to port LLVM to the platform in question. IA-64 was removed in 2009, but it might be possible to resurrect that out of tree if there's interest and maybe even get it re-accepted upstream. I'll point out that AIX, Solaris, and QNX have done the necessary porting work to get LLVM and Rust working over the past couple years, so it's not out of the question for other platforms to do so as well. And, for the avoidance of doubt, I would be absolutely delighted if we were able to support additional platforms with Rust as well.

Quoted 2 lines

I cannot really say how hard or easy it is to port LLVM to a different platform. I'd be surprised though if that work really was that easy.

I think it's an interesting characterisation indeed.

Quoted 10 lines
Quoted 9 lines

Also, the approach of making it an optional component directly contradicts the proposed policy I wrote up. That's a recipe for additional burdensome work maintaining two implementations, when we actually want to make it easier for people to contribute functionality. It also doesn't provide any of the memory safety benefits or address any of the concerns from governments, security professionals, and other parties about the real and substantial risks of continuing to develop in C.

Quoted 5 lines

The only reason why we want to have it as an optional component is to make the transitioning period easier for downstream distributors. And the intent is not to convert major components -- it should be trivial components that we can use as test balloons, similar to how we did it for all of our C99 test balloons.

Yes, even if it were just for one release, having it optional for something would mean we can adjust packaging without some huge pressure where git had 0 Rust in one release and then mandatory Rust in another.

(I would of course prefer far more than one release, but I've tried throughout this thread to give options even if the one I'd prefer isn't pursued, not "teeth gnash").

sam

#151 lore raw

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

In reply to Patrick Steinhardt
Quoted 9 lines · Patrick Steinhardt

If we cannot find anything, an alternative could also be to take a very simple subsystem that doesn't see a lot of changes and convert that to Rust. We'd retain both implementations in that case, which I mentioned is painful because we now have to keep both in sync. But if we say that this is a testballoon, only, and that we don't continue to convert other code until Git 3.0, then that might be fine.

"varint.c" could be a good match. It's trivial, only 30 lines of code, and completely standalone.

I am afraid that it is a bit too trivial. I didn't mention this possibility of maintaining parallel implementations, but the quiescent area I had in mind was patch-delta.c (no, I am not that ambitious to suggest diff-delta.c as the first example).

Quoted 3 lines

We could still build new and optional functionality via Rust, but I guess it also doesn't hurt to have a test balloon that is part of libgit.a to test interoperability.

OK.

#157 lore raw

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

In reply to Patrick Steinhardt
Quoted 8 lines · Patrick Steinhardt

The only reason why we want to have it as an optional component is to make the transitioning period easier for downstream distributors. And the intent is not to convert major components -- it should be trivial components that we can use as test balloons, similar to how we did it for all of our C99 test balloons.

We cannot just pull the rug away under their feet without advance notice that this is going to happen.

I think making Rust optional for at least 1 version is a viable path. I'm not opposed to that idea; it was just easier to develop and talk about Rust as a hard dependency. I needed to know if making Rust optional was in demand before spending any significant time on that.

#158 lore raw

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

In reply to Patrick Steinhardt
Quoted 3 lines · Patrick Steinhardt
Quoted 1 line · brian m. carlson

On 2025-09-03 at 05:40:54, Patrick Steinhardt wrote:

[snip]

Quoted 9 lines
Quoted 8 lines

Also, the approach of making it an optional component directly contradicts the proposed policy I wrote up. That's a recipe for additional burdensome work maintaining two implementations, when we actually want to make it easier for people to contribute functionality. It also doesn't provide any of the memory safety benefits or address any of the concerns from governments, security professionals, and other parties about the real and substantial risks of continuing to develop in C.

Quoted 8 lines

The only reason why we want to have it as an optional component is to make the transitioning period easier for downstream distributors. And the intent is not to convert major components -- it should be trivial components that we can use as test balloons, similar to how we did it for all of our C99 test balloons.

We cannot just pull the rug away under their feet without advance notice that this is going to happen.

I find this statement a bit problematic for four reasons:

(1) "without advance notice" was already pointed out to be inaccurate in this thread, including in the exact email you are responding to; you could argue that there hasn't been _sufficient_ advance notice, but then there should be more details about what is and isn't sufficient. Merely repeating this claim which brian just barely pointed out to you as false almost feels dishonest.

(2) "pull the rug away" seems hyperbolic. I would have liked some explanation as to how a transition period is expected to help, and how the existing transition period has been insufficient. You do hint a little at the former, which I'll discuss more in point 4, but you
neglect the latter to the point of pretending it didn't exist. In
short, why is a further transition period needed, and how will it differ from the existing one we've already had? It's not clear to me why distributors must immediately update to the latest git version. Taylor discussed this aspect in detail in this thread; you even responded briefly (and tangentially?), but still as far as I can tell presume the latest and greatest is mandatory for them to adopt without stating why. Maybe they do need to adopt the latest and greatest, but I haven't seen folks state why that's the case. Did I miss it?

It also feels like Rust support is being lumped in with "breaking changes", which to me feels misleading. Historically, we have talked about breaking changes and deprecation periods and such so that users could adjust scripts or their command lines such that they would work across multiple versions of Git. The Rust case is somewhat different in that we're not discussing behavioral changes of git, merely implementation differences. If someone has both a C-only version of git and a newer version of git that was built with both Rust and C, any commands they run should behave the same as far as the C-vs-Rust goes (unless we have our normal discussions about specific behavior and any deprecations we want to do related to it, of course).

I do agree that reduced platform support is a negative change (though Rust brings other advantages that may offset this downside depending on your viewpoint), but I don't see why it's a breaking change and especially not a "pull the rug away under their feet" change.

(3) the use of "cannot" presupposes the policy stance which we are having a discussion about, which, whether intended or not, feels like an unfair way to attempt to shut down the conversation.

(4) you suggest that adding Rust as an optional component should avoid the problem, yet we've already had Rust as an optional component for the last three releases, going back to 2.49.0. (libgit-rs and libgit-sys). In this case, you helpfully provided some details distinguishing the type of optional component you want -- the reference to a test balloon suggests you want an optional component that is turned on by default (but which users can easily turn off). Am I correct that this is your intention? If that's the case, then that's a useful distinction, but I think that distinction needs to be made a bit more clearly (and as a side effect, acknowledge that Rust has already been optionally shipped in some form, and was even specifically highlighted by GitHub's and GitLab's blog posts about the v2.49.0 release, among other places)

Quoted 7 lines
Quoted 6 lines

For example, there is zero chance I will implement any of the SHA-1/SHA-256 compatibility code twice. I'm already doing that in my free time without any compensation at all and it's unreasonable to expect me to do it twice or even to #ifdef out all the places it would need to go. I am happy to let someone else take responsibility for the project instead, however, if they would like to do those things.

Quoted 5 lines

And that's totally fair. From my point of view, this compatibility code is a _new_ feature that we are adding to Git. And as I mentioned, I think it is reasonable to say that new features may be implemented in Rust now already, as platforms that aren't yet ready wouldn't lose any existing functionality.

Am I correct to understand that you're suggesting a policy where brian cannot modify any existing code to be written in Rust, and can only add new Rust code? Perhaps the SHA-1/SHA-256 compatibility code is just new code, or can be done with minimal changes to existing C code while adding new code. If so, maybe this is a workable solution for him.

But if it can't be done with minimal changes to existing C code and this policy would impair brian's ability to deliver the compatibility code, then I think this policy would be unworkable. I really don't want to hamstring brian's ability to implement the compatibility code. It has sat dormant for years with no one else stepping up to the plate, it's a really important project, and brian has time and energy now. I don't want any chicken-and-egg problems introduced for him with the 3.0 release. Even though I've been working with Ezekiel on xdiff, and I'm obviously a bit biased in that area, I find the sha1-sha256 compatibility work to be more critical and something we should do everything possible to facilitate.

Quoted 3 lines

I think most or even all of the contributors are on board. But we never really talked about timelines, or how we want to introduce Rust, so that's a discussion we need to have now.

Agreed.

#156 lore raw

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

In reply to Sam James
Quoted 2 lines · Sam James

Patrick Steinhardt <[email protected]> writes:

[...]

Quoted 15 lines
Quoted 9 lines
Quoted 8 lines

Also, the approach of making it an optional component directly contradicts the proposed policy I wrote up. That's a recipe for additional burdensome work maintaining two implementations, when we actually want to make it easier for people to contribute functionality. It also doesn't provide any of the memory safety benefits or address any of the concerns from governments, security professionals, and other parties about the real and substantial risks of continuing to develop in C.

Quoted 5 lines

The only reason why we want to have it as an optional component is to make the transitioning period easier for downstream distributors. And the intent is not to convert major components -- it should be trivial components that we can use as test balloons, similar to how we did it for all of our C99 test balloons.

Quoted 7 lines

Yes, even if it were just for one release, having it optional for something would mean we can adjust packaging without some huge pressure where git had 0 Rust in one release and then mandatory Rust in another.

(I would of course prefer far more than one release, but I've tried throughout this thread to give options even if the one I'd prefer isn't pursued, not "teeth gnash").

Rust has been an optional component of git for the last three releases already, going back to v2.49.0. See the v2.49.0 release notes, or e.g. https://github.blog/open-source/git/highlights-from-git-2-49/
[*].

[*] A quote: "This release marks a major milestone in the Git project with the first pieces of Rust code being checked in..."

#159 lore raw

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

In reply to Elijah Newren
Quoted 22 lines · Elijah Newren
Quoted 12 lines · Patrick Steinhardt
Quoted 9 lines · brian m. carlson

On 2025-09-03 at 05:40:54, Patrick Steinhardt wrote:
Also, the approach of making it an optional component directly contradicts the proposed policy I wrote up. That's a recipe for additional burdensome work maintaining two implementations, when we actually want to make it easier for people to contribute functionality. It also doesn't provide any of the memory safety benefits or address any of the concerns from governments, security professionals, and other parties about the real and substantial risks of continuing to develop in C.

Quoted 8 lines

The only reason why we want to have it as an optional component is to make the transitioning period easier for downstream distributors. And the intent is not to convert major components -- it should be trivial components that we can use as test balloons, similar to how we did it for all of our C99 test balloons.

We cannot just pull the rug away under their feet without advance notice that this is going to happen.

Quoted 8 lines

I find this statement a bit problematic for four reasons:

(1) "without advance notice" was already pointed out to be inaccurate in this thread, including in the exact email you are responding to; you could argue that there hasn't been _sufficient_ advance notice, but then there should be more details about what is and isn't sufficient. Merely repeating this claim which brian just barely pointed out to you as false almost feels dishonest.

I think there is a difference between communication that happens on the mailing list/contributors summit and communication that is intended for the broader ecosystem:

- The former is basically us developers discussing potential futures and reviewing patches. It would be _nice_ if distro maintainers of Git were to read these, but given the large volume of traffic in general I think it unlikely that majority of maintainers is keeping up with that traffic.

- The latter is in the form of e.g. our release notes as well as our BreakingChanges document. These _are_ intended to be reviewed by maintainers, and the blame is on them if they don't do so.

We have never communicated either via release notes or via any kind of committed document that Rust is going to become mandatory. There have been lots of large threads discussing it, true. But navigating these threads and estimating consensus isn't easy even for us developers, so it's going to be even harder for outsiders to the community.

Quoted 5 lines

(2) "pull the rug away" seems hyperbolic. I would have liked some explanation as to how a transition period is expected to help, and how the existing transition period has been insufficient. You do hint a little at the former, which I'll discuss more in point 4, but you
neglect the latter to the point of pretending it didn't exist. In

Quoted 8 lines

short, why is a further transition period needed, and how will it differ from the existing one we've already had? It's not clear to me why distributors must immediately update to the latest git version. Taylor discussed this aspect in detail in this thread; you even responded briefly (and tangentially?), but still as far as I can tell presume the latest and greatest is mandatory for them to adopt without stating why. Maybe they do need to adopt the latest and greatest, but I haven't seen folks state why that's the case. Did I miss it?

The problem here is that we don't have a story to tell yet. I agree that not everyone always needs the latest and greatest, which is also why I mentioned that I think it's fine for _new_ features to be developed in Rust right away.

But the story is altogether different for bug and security fixes.

- We of course backport security fixes, but would that also be the case if we had ported the subsystem to Rust already and now had to implement the security fix twice?

- What happens if only the old C version has a security bug? Do we still fix it?

- Likewise, what happens with important bug fixes? We tend to backport those that are easy-ish to backport, but if people are potentially stuck with an older Git version for years it will become harder for us to do so.

I think without us having a proper answer to these questions we _are_ pulling the rug away. Distros may be stuck with an old version of Git for a significant time, and from my point of view we have to do a couple of compromises there.

Quoted 12 lines

It also feels like Rust support is being lumped in with "breaking changes", which to me feels misleading. Historically, we have talked about breaking changes and deprecation periods and such so that users could adjust scripts or their command lines such that they would work across multiple versions of Git. The Rust case is somewhat different in that we're not discussing behavioral changes of git, merely implementation differences. If someone has both a C-only version of git and a newer version of git that was built with both Rust and C, any commands they run should behave the same as far as the C-vs-Rust goes (unless we have our normal discussions about specific behavior and any deprecations we want to do related to it, of course).

Quoted 4 lines

I do agree that reduced platform support is a negative change (though Rust brings other advantages that may offset this downside depending on your viewpoint), but I don't see why it's a breaking change and especially not a "pull the rug away under their feet" change.

I honestly don't quite understand this perspective. How isn't it breaking that you cannot use that Git version at all anymore?

Quoted 3 lines

(3) the use of "cannot" presupposes the policy stance which we are having a discussion about, which, whether intended or not, feels like an unfair way to attempt to shut down the conversation.

Sorry, that's not my intent.

Quoted 4 lines

(4) you suggest that adding Rust as an optional component should avoid the problem, yet we've already had Rust as an optional component for the last three releases, going back to 2.49.0. (libgit-rs and libgit-sys).

I don't really think that either libgit-rs or libgit-sys help in any way. These are part of "contrib/", not built by default, and neither are they consumed by anyone out there. So there is no reason for anyone to build that library to the best of my knowledge.

Quoted 9 lines

In this case, you helpfully provided some details distinguishing the type of optional component you want -- the reference to a test balloon suggests you want an optional component that is turned on by default (but which users can easily turn off). Am I correct that this is your intention? If that's the case, then that's a useful distinction, but I think that distinction needs to be made a bit more clearly (and as a side effect, acknowledge that Rust has already been optionally shipped in some form, and was even specifically highlighted by GitHub's and GitLab's blog posts about the v2.49.0 release, among other places)

Yes. I think we need to have a test balloon that allows us to iterate on the build infrastructure and allows distributors to test with them. I think that test balloon needs to be integrated into core Git so that it is part of the normal build process, because otherwise it wouldn't have any exposure at all and thus not serve its purpose.

Quoted 13 lines
Quoted 7 lines
Quoted 6 lines

For example, there is zero chance I will implement any of the SHA-1/SHA-256 compatibility code twice. I'm already doing that in my free time without any compensation at all and it's unreasonable to expect me to do it twice or even to #ifdef out all the places it would need to go. I am happy to let someone else take responsibility for the project instead, however, if they would like to do those things.

Quoted 5 lines

And that's totally fair. From my point of view, this compatibility code is a _new_ feature that we are adding to Git. And as I mentioned, I think it is reasonable to say that new features may be implemented in Rust now already, as platforms that aren't yet ready wouldn't lose any existing functionality.

Quoted 6 lines

Am I correct to understand that you're suggesting a policy where brian cannot modify any existing code to be written in Rust, and can only add new Rust code? Perhaps the SHA-1/SHA-256 compatibility code is just new code, or can be done with minimal changes to existing C code while adding new code. If so, maybe this is a workable solution for him.

Yeah, that's my hope, as well. There's probably nouances to this though, and we'll have to figure it out once the series hits the mailing list. So...

Quoted 11 lines

But if it can't be done with minimal changes to existing C code and this policy would impair brian's ability to deliver the compatibility code, then I think this policy would be unworkable. I really don't want to hamstring brian's ability to implement the compatibility code. It has sat dormant for years with no one else stepping up to the plate, it's a really important project, and brian has time and energy now. I don't want any chicken-and-egg problems introduced for him with the 3.0 release. Even though I've been working with Ezekiel on xdiff, and I'm obviously a bit biased in that area, I find the sha1-sha256 compatibility work to be more critical and something we should do everything possible to facilitate.

... I guess we'll have to see how this looks like in the end. If the series rewrites a bunch of subsystems in Rust I think we should figure out whether we can do without that. Or, in the worst case, whether it is feasible to conditionally compile some of the code with either C or Rust, even though nobody likes that.

Patrick

#152 lore raw

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

In reply to Junio C Hamano
Quoted 9 lines · Junio C Hamano
Quoted 7 lines · Patrick Steinhardt

If we cannot find anything, an alternative could also be to take a very simple subsystem that doesn't see a lot of changes and convert that to Rust. We'd retain both implementations in that case, which I mentioned is painful because we now have to keep both in sync. But if we say that this is a testballoon, only, and that we don't continue to convert other code until Git 3.0, then that might be fine.

Quoted 7 lines
Quoted 2 lines

"varint.c" could be a good match. It's trivial, only 30 lines of code, and completely standalone.

I am afraid that it is a bit too trivial. I didn't mention this possibility of maintaining parallel implementations, but the quiescent area I had in mind was patch-delta.c (no, I am not that ambitious to suggest diff-delta.c as the first example).

Oh, it certainly is very trivial. I think for the initial infra this is a good trait though, as it means that we don't yet have to care about interop between different parts of Git and can rather focus on the bigger topic, which is the process for how to introduce Rust in the first place.

But I agree, once we have the initial Rust infra landed we should then also gain familiarity with more involved subsystems that _do_ require us to hook into other subsystems so that we are forced to extend our build systems as needed.

Patrick

#171 lore raw

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

In reply to Elijah Newren

Hi Elijah

Quoted 7 lines · Elijah Newren

(1) "without advance notice" was already pointed out to be inaccurate in this thread, including in the exact email you are responding to; you could argue that there hasn't been _sufficient_ advance notice, but then there should be more details about what is and isn't sufficient. Merely repeating this claim which brian just barely pointed out to you as false almost feels dishonest.

I think there is a difference of understanding of what constitutes "advanced notice". While it is true that there have been discussions on the list for a couple of years where people were clearly enthusiastic about adopting rust those discussions have always petered out after concerns about portability were raised without us actually adopting rust. In those discussions there has been no clear conclusion about whether rust would be mandatory or optional. I think from the point of view of an outsider who was following the mailing list it has not been clear exactly where the rust discussion was going. For someone not following the mailing list but just reading the release notes there has been no indication that we're thinking of rust mandatory for building git as opposed to offering rust bindings for our C code.

Quoted 3 lines

(2) "pull the rug away" seems hyperbolic. I would have liked some explanation as to how a transition period is expected to help, and how the existing transition period has been insufficient.

I'm very unclear what "the existing transition period" has been

Quoted 4 lines

[...] > (4) you suggest that adding Rust as an optional component should avoid the problem, yet we've already had Rust as an optional component for the last three releases, going back to 2.49.0. (libgit-rs and libgit-sys).

Right but from the point of view of someone trying to build git on a platform without rust support there is a world of difference between having some optional bindings for rust external projects to use, and making rust mandatory to build git.

I would like us to adopt rust but I am concerned about the implications for platforms without rust and think we should give some notice in the form a clear announcement in the release notes once we have a concrete plan. That plan should include a decision on what commitment we can realistically offer with regard to security updates for platforms without a rust compiler so maintainers on those platforms have a clear idea of how long they will be supported.

Thanks

Phillip

#172 lore raw

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

Quoted 33 lines · Phillip Wood

Hi Elijah

Quoted 7 lines · Elijah Newren

(1) "without advance notice" was already pointed out to be inaccurate
in this thread, including in the exact email you are responding to; you could argue that there hasn't been _sufficient_ advance notice, but then there should be more details about what is and isn't sufficient. Merely repeating this claim which brian just barely pointed out to you as false almost feels dishonest.

I think there is a difference of understanding of what constitutes "advanced notice". While it is true that there have been discussions on the list for a couple of years where people were clearly enthusiastic about adopting rust those discussions have always petered out after concerns about portability were raised without us actually adopting rust. In those discussions there has been no clear conclusion about whether rust would be mandatory or optional. I think from the point of view of an outsider who was following the mailing list it has not been clear exactly where the rust discussion was going. For someone not following the mailing list but just reading the release notes there has been no indication that we're thinking of rust mandatory for building git as opposed to offering rust bindings for our C code.

Quoted 3 lines

(2) "pull the rug away" seems hyperbolic. I would have liked some explanation as to how a transition period is expected to help, and how the existing transition period has been insufficient.

I'm very unclear what "the existing transition period" has been

Quoted 1 line

[...] > (4) you suggest that adding Rust as an optional component

should avoid

Quoted 8 lines
Quoted 3 lines

the problem, yet we've already had Rust as an optional component for the last three releases, going back to 2.49.0. (libgit-rs and libgit-sys).

Right but from the point of view of someone trying to build git on a platform without rust support there is a world of difference between having some optional bindings for rust external projects to use, and making rust mandatory to build git.

Entirely agreed with the whole email.

I'll make some further observations wrt bindings:

1) Distributions often don't enable bindings for languages unless a user requests them, or at the very least they're considered low priority (and bindings existing for a language in a project do *not* imply the project is going to be rewritten in that language);

2) There would be no value in distributions building Rust bindings because Rust doesn't really support "system-wide" libraries. It doesn't make sense as far as I can tell to install the bindings right now. I don't even know where Rust bindings should be installed to, I've never seen a package want them installed before.

3) It's not integrated with the Meson build system we're using so I wouldn't have paid any attention to it, at least unless a user requested it;

4) It's in contrib/.

Quoted 9 lines

I would like us to adopt rust but I am concerned about the implications for platforms without rust and think we should give some notice in the form a clear announcement in the release notes once we have a concrete plan. That plan should include a decision on what commitment we can realistically offer with regard to security updates for platforms without a rust compiler so maintainers on those platforms have a clear idea of how long they will be supported.

Quoted 3 lines

Thanks

Phillip

sam

#173 lore raw

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

In reply to Phillip Wood
Quoted 2 lines · Phillip Wood

I would like us to adopt rust but I am concerned about the implications for platforms without rust and think we should give some notice in the form a clear announcement in the release notes once we have a concrete plan. That plan should include a decision on what commitment we can realistically offer with regard to security updates for platforms without a rust compiler so maintainers on those platforms have a clear idea of how long they will be supported.

Here's what such an announcement might look like

This release introduces an optional dependency on rust that is enabled by default. Platforms without a rust compiler can continue to build git by passing NO_RUST=1. In six months time we plan to make rust mandatory for building git. From that point git 2.x.y (the last version that can be built without rust) will continue to receive security updates for three years.

To me the important elements are:

1) There is a short period where rust is optional. This allows
(i) Distributors on platforms without a rust compiler time to notify their users that in the future they will only be able to offer security updates.
(ii) Distributors on platforms with a rust compiler time to adjust
their build procedures to include rust.
(iii) The git project time to gain experience of using rust and writing
the necessary bindings while building with it is optional.

2) Rust is enabled by default so platforms without a rust compiler are made aware of the problem but have an easy way to continue to build git while rust is optional.

3) There is a period of a small number of years where we continue to provide security updates for a version of git that can be built without rust. This is intended to allow a realistic time for distributors on platforms without a rust compiler to port one or make other arrangements for providing future security updates without placing an undue burden on the project to provide security updates for niche platforms indefinitely.

Thanks

Phillip

#174 lore raw

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

Quoted 34 lines · Phillip Wood
Quoted 8 lines · Phillip Wood

I would like us to adopt rust but I am concerned about the implications for platforms without rust and think we should give some notice in the form a clear announcement in the release notes once we have a concrete plan. That plan should include a decision on what commitment we can realistically offer with regard to security updates for platforms without a rust compiler so maintainers on those platforms have a clear idea of how long they will be supported.

Here's what such an announcement might look like

This release introduces an optional dependency on rust that is enabled by default. Platforms without a rust compiler can continue to build git by passing NO_RUST=1. In six months time we plan to make rust mandatory for building git. From that point git 2.x.y (the last version that can be built without rust) will continue to receive security updates for three years.

To me the important elements are:

1) There is a short period where rust is optional. This allows
(i) Distributors on platforms without a rust compiler time to notify their users that in the future they will only be able to offer security updates.
(ii) Distributors on platforms with a rust compiler time to adjust
their build procedures to include rust.
(iii) The git project time to gain experience of using rust and writing
the necessary bindings while building with it is optional.

2) Rust is enabled by default so platforms without a rust compiler are made aware of the problem but have an easy way to continue to build git while rust is optional.

Quoted 7 lines

3) There is a period of a small number of years where we continue to provide security updates for a version of git that can be built without rust. This is intended to allow a realistic time for distributors on platforms without a rust compiler to port one or make other arrangements for providing future security updates without placing an undue burden on the project to provide security updates for niche platforms indefinitely.

Something like this is part of the BreakingChanges document I'm proposing in [1]. I think we should also highlight this upcoming change in the next release notes, with a pointer to that document.

Patrick

[1]: <[email protected]>

#175 lore raw

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

In reply to Phillip Wood
Quoted 9 lines · Phillip Wood

This release introduces an optional dependency on rust that is enabled by default. Platforms without a rust compiler can continue to build git by passing NO_RUST=1. In six months time we plan to make rust mandatory for building git. From that point git 2.x.y (the last version that can be built without rust) will continue to receive security updates for three years.

To me the important elements are:

Quoted 8 lines

1) There is a short period where rust is optional. This allows
(i) Distributors on platforms without a rust compiler time to notify their users that in the future they will only be able to offer security updates.
(ii) Distributors on platforms with a rust compiler time to adjust
their build procedures to include rust.
(iii) The git project time to gain experience of using rust and writing
the necessary bindings while building with it is optional.

Good. I am not sure "short" should be an important element, but having a known and agreed-upon deadline helps.

Quoted 3 lines

2) Rust is enabled by default so platforms without a rust compiler are made aware of the problem but have an easy way to continue to build git while rust is optional.

Obviously there is nothing to disagree with here, as it is the definition of the word "optional" ;-).

Quoted 7 lines

3) There is a period of a small number of years where we continue to provide security updates for a version of git that can be built without rust. This is intended to allow a realistic time for distributors on platforms without a rust compiler to port one or make other arrangements for providing future security updates without placing an undue burden on the project to provide security updates for niche platforms indefinitely.

I am not willing to see such a support for multiple years, though. If the first item is 6 months, this backporting stale releases should be on the same order of timeperiod.

If it were "3 years of optional period, 18 months of backporting security updates", I would find it more realistic. It would give those platform maintainers enough time to robby, fundraise, or otherwise campaign to bring Rust on their system. I personally find that 6 months is way too short (if we are _only_ looking for an excuse to say "we have given them ample time to react, and now it is their problem", 6 months may be good enough, though).

#160 lore raw

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

In reply to Patrick Steinhardt

Sorry for the delay; life outside of work is challenging at the moment...

Quoted 47 lines · Patrick Steinhardt
Quoted 22 lines · Elijah Newren
Quoted 12 lines · Patrick Steinhardt
Quoted 9 lines · brian m. carlson

On 2025-09-03 at 05:40:54, Patrick Steinhardt wrote:
Also, the approach of making it an optional component directly contradicts the proposed policy I wrote up. That's a recipe for additional burdensome work maintaining two implementations, when we actually want to make it easier for people to contribute functionality. It also doesn't provide any of the memory safety benefits or address any of the concerns from governments, security professionals, and other parties about the real and substantial risks of continuing to develop in C.

Quoted 8 lines

The only reason why we want to have it as an optional component is to make the transitioning period easier for downstream distributors. And the intent is not to convert major components -- it should be trivial components that we can use as test balloons, similar to how we did it for all of our C99 test balloons.

We cannot just pull the rug away under their feet without advance notice that this is going to happen.

Quoted 8 lines

I find this statement a bit problematic for four reasons:

(1) "without advance notice" was already pointed out to be inaccurate in this thread, including in the exact email you are responding to; you could argue that there hasn't been _sufficient_ advance notice, but then there should be more details about what is and isn't sufficient. Merely repeating this claim which brian just barely pointed out to you as false almost feels dishonest.

I think there is a difference between communication that happens on the mailing list/contributors summit and communication that is intended for the broader ecosystem:

- The former is basically us developers discussing potential futures and reviewing patches. It would be _nice_ if distro maintainers of Git were to read these, but given the large volume of traffic in general I think it unlikely that majority of maintainers is keeping up with that traffic.

- The latter is in the form of e.g. our release notes as well as our BreakingChanges document. These _are_ intended to be reviewed by maintainers, and the blame is on them if they don't do so.

Quoted 5 lines

We have never communicated either via release notes or via any kind of committed document that Rust is going to become mandatory. There have been lots of large threads discussing it, true. But navigating these threads and estimating consensus isn't easy even for us developers, so it's going to be even harder for outsiders to the community.

I like this framing; this is useful.

I agree that we haven't communicated that it'll be mandatory, though we have communicated beyond the list that Rust was likely coming:
* The contributor summit notes on Rust (posted at
https://lore.kernel.org/git/Zu2D%[email protected]/) were widely picked up at other sites (e.g.
https://lwn.net/Articles/998115/,
https://www.reddit.com/r/linux/comments/1hcsvk5/nonstop_discussion_around_adding_rust_to_git/)
* The release notes mention initial Rust inclusion
(https://lore.kernel.org/git/[email protected]/, "Foreign language interface for Rust into our code base has been added.")
* The GitHub blog on highlights from 2.49.0 (widely linked at news
sites even in preference to the release notes) adds more detail: "This release marks a major milestone in the Git project with the first pieces of Rust code being checked in"
(https://github.blog/open-source/git/highlights-from-git-2-49/)

Now, I can fully get behind that this may be _inadequate_ notice, and I really like the idea of a test balloon. I'm just noting that I very much disagree with the characterization that there has been no notice beyond the mailing list about Rust likely coming at some point, and want us to make sure that if we delay, we use the time to meaningfully provide more notice than we have already. Another optional Rust component that doesn't build by default, for example, fails that test.

Quoted 33 lines
Quoted 5 lines

(2) "pull the rug away" seems hyperbolic. I would have liked some explanation as to how a transition period is expected to help, and how the existing transition period has been insufficient. You do hint a little at the former, which I'll discuss more in point 4, but you
neglect the latter to the point of pretending it didn't exist. In

Quoted 8 lines

short, why is a further transition period needed, and how will it differ from the existing one we've already had? It's not clear to me why distributors must immediately update to the latest git version. Taylor discussed this aspect in detail in this thread; you even responded briefly (and tangentially?), but still as far as I can tell presume the latest and greatest is mandatory for them to adopt without stating why. Maybe they do need to adopt the latest and greatest, but I haven't seen folks state why that's the case. Did I miss it?

The problem here is that we don't have a story to tell yet. I agree that not everyone always needs the latest and greatest, which is also why I mentioned that I think it's fine for _new_ features to be developed in Rust right away.

But the story is altogether different for bug and security fixes.

- We of course backport security fixes, but would that also be the case if we had ported the subsystem to Rust already and now had to implement the security fix twice?

- What happens if only the old C version has a security bug? Do we still fix it?

- Likewise, what happens with important bug fixes? We tend to backport those that are easy-ish to backport, but if people are potentially stuck with an older Git version for years it will become harder for us to do so.

Quoted 4 lines

I think without us having a proper answer to these questions we _are_ pulling the rug away. Distros may be stuck with an old version of Git for a significant time, and from my point of view we have to do a couple of compromises there.

These are good questions...but they are ones to which I suspect delaying will not provide the answer. In fact, I don't think we'll _ever_ have the answer to these questions, no matter how much we delay or discuss. Traditionally, if an issue was more severe, it has been backported to more versions, even if the backport wasn't trivial. There's a cost/benefit tradeoff to be had for each vulnerability, and changes to the area making backports either be easy or hard always need to be weighed against the severity of the vulnerability. I don't see that changing, and overpromising hurts in the long run probably more than having no guidance. I just don't see us coming up with "proper answers" (which I'm guessing means fully spelled out answers?) to these questions ahead of time. The answer to all of them is probably "we'll weigh the severity of the issue and the cost to backport and give the last C-only version significant extra weight in our considerations". I doubt we'll ever be able to promise any more detail than that until we get concrete cases; I'm not even sure that this statement is acceptable to everyone on the list from the overpromising angle despite being as incomplete as it is.

Quoted 12 lines
Quoted 12 lines

It also feels like Rust support is being lumped in with "breaking changes", which to me feels misleading. Historically, we have talked about breaking changes and deprecation periods and such so that users could adjust scripts or their command lines such that they would work across multiple versions of Git. The Rust case is somewhat different in that we're not discussing behavioral changes of git, merely implementation differences. If someone has both a C-only version of git and a newer version of git that was built with both Rust and C, any commands they run should behave the same as far as the C-vs-Rust goes (unless we have our normal discussions about specific behavior and any deprecations we want to do related to it, of course).

Quoted 7 lines
Quoted 4 lines

I do agree that reduced platform support is a negative change (though Rust brings other advantages that may offset this downside depending on your viewpoint), but I don't see why it's a breaking change and especially not a "pull the rug away under their feet" change.

I honestly don't quite understand this perspective. How isn't it breaking that you cannot use that Git version at all anymore?

Users might often face cases where they have to use different versions of git -- at home, at work, on different work machines, etc. As such, when something forces workflow changes, we have to be cognizant of that and provide deprecation periods, release announcement notices, etc. That's the point of our care around breaking changes.

If _distributors_ can't build a new version of git, users can still use older versions. They don't have to change their workflows. When distributors eventually figure out how to build a newer version (because they work around pthreads not existing on their platform, or they add stdbool to their compiler, or they port Rust to their system or whatever), then when the new version becomes available, users can use it without changes to their workflow. The _users_ weren't broken.

I still don't see why distributors _must_ ship the latest version of Git and why folks on some platforms are considered broken if they are using a slightly older version. Let me ask again: has anyone answered why this is considered mandatory? If they have, I've missed it, but I've asked multiple times. Even if you want to lump "distributors cannot build a newer version" under the umbrella of "breaking changes", I argue it's a much different kind of break and one which merits different timelines for handling than e.g. lumping it in with 3.0.

Quoted 5 lines
Quoted 3 lines

(3) the use of "cannot" presupposes the policy stance which we are having a discussion about, which, whether intended or not, feels like an unfair way to attempt to shut down the conversation.

Sorry, that's not my intent.

Thanks, and I appreciate you patiently explaining your point of view in more detail.

Quoted 9 lines
Quoted 4 lines

(4) you suggest that adding Rust as an optional component should avoid the problem, yet we've already had Rust as an optional component for the last three releases, going back to 2.49.0. (libgit-rs and libgit-sys).

I don't really think that either libgit-rs or libgit-sys help in any way. These are part of "contrib/", not built by default, and neither are they consumed by anyone out there. So there is no reason for anyone to build that library to the best of my knowledge.

I'm fully willing to accept they are inadequate notice (and perhaps even barely helpful), but disagree with the characterization that they don't help at all:
* they were consumed in the past by Google
* they recently received patches from someone outside Google
(https://lore.kernel.org/git/[email protected]/)
* they were mentioned in the release notes highlighting at a minimum
that Rust is being added to Git.
* they were highlighted in blog posts from both GitLab and GitHub as
being noteworthy new things in the v2.49.0 release

I agree with you there is certainly more we can do, and I like your idea of a test ballon. Let's just avoid repeating the problem of adding an optional component that no one will try to build except for those for whom we know can build it; doing that would provide no more notice and thus provide no incremental benefit over libgit-rs and libgit-sys.

#161 lore raw

RE: [PATCH v3 02/15] xdiff: introduce rust

Quoted 2 lines · Elijah Newren

Sorry for the delay; life outside of work is challenging at the moment...

I am going to address the critical point mentioned below and snip the rest for brevity.

Quoted 7 lines

I still don't see why distributors _must_ ship the latest version of Git and why folks on some platforms are considered broken if they are using a slightly older version. Let me ask again: has anyone answered why this is considered mandatory? If they have, I've missed it, but I've asked multiple times. Even if you want to lump "distributors cannot build a newer version" under the umbrella of "breaking changes", I argue it's a much different kind of break and one which merits different timelines for handling than e.g. lumping it in with 3.0.

I do not see that distributors _must_ ship the latest version. Suppose we are on 2.51.0 and a CVE comes out that prohibits its use in an organization that does not allow any medium-high to high CVEs. This represents hundreds of thousands of impacted users in my community alone. How does the CVE get applied if the latest cannot be built and the git team does not apply the CVE fixes to old versions. Personally, I do not care if git versions are different between work and home, or even between CI/CD and other platforms. I don't even care if I have to use JGit instead of git in some situations (which I see is a likely outcome of this discussion). Is there an official statement of what an LTS means? In other projects LTS is typically, and formally by policy 5 years. From what others have said here, positions of 6 months, 3 years, and "apply it yourself if you want to continue to use git" have been made.

The core problem of adding a breaking dependency is when a CVE comes out that prohibits git from being used at all. If the git team is not going to provide a clear statement, one way or another, if how CVEs (at whatever severity level) will not have a commitment of any kind, then distributors are essentially cast adrift and on our own. It would be helpful of those of us who donate our time, for no compensation, are able to plan for this in a meaningful way. Please remember that we have to justify our participation to our management teams to be allowed to continue to participate. Nothing is free from this end and if fixing (not just applying fixes) CVEs are now 100% our responsibility, if would be critical to know that when we build our business cases to our bosses, who I am fairly certain will say an emphatic no.

Also remember that without support from the git team, the code base is no longer the same, meaning the auditors will not necessarily accept fixes from third-party sources. This particular point enabled adoption on some platforms, particularly NonStop. Adoption was at 1-2 customers when we had a divergent code based because some platform fixes being different from the standard code-base and could not be certified as valid. Once the code-base because common, adoption was rapid and enthusiastic. If this goes away, I suspect that adoption rates will go negative. I am aware that that particular discussion is actually happening in some organizations in my community right now, with companies looking for alternatives to git based on this discussion thread.

With over a decade of respect and participation,
Randall

#170 lore raw

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

In reply to Elijah Newren
Quoted 25 lines · Elijah Newren
Quoted 19 lines · Patrick Steinhardt

The problem here is that we don't have a story to tell yet. I agree that not everyone always needs the latest and greatest, which is also why I mentioned that I think it's fine for _new_ features to be developed in Rust right away.

But the story is altogether different for bug and security fixes.

- We of course backport security fixes, but would that also be the case if we had ported the subsystem to Rust already and now had to implement the security fix twice?

- What happens if only the old C version has a security bug? Do we still fix it?

- Likewise, what happens with important bug fixes? We tend to backport those that are easy-ish to backport, but if people are potentially stuck with an older Git version for years it will become harder for us to do so.

Quoted 4 lines

I think without us having a proper answer to these questions we _are_ pulling the rug away. Distros may be stuck with an old version of Git for a significant time, and from my point of view we have to do a couple of compromises there.

Quoted 12 lines

These are good questions...but they are ones to which I suspect delaying will not provide the answer. In fact, I don't think we'll _ever_ have the answer to these questions, no matter how much we delay or discuss. Traditionally, if an issue was more severe, it has been backported to more versions, even if the backport wasn't trivial. There's a cost/benefit tradeoff to be had for each vulnerability, and changes to the area making backports either be easy or hard always need to be weighed against the severity of the vulnerability. I don't see that changing, and overpromising hurts in the long run probably more than having no guidance. I just don't see us coming up with "proper answers" (which I'm guessing means fully spelled out answers?) to these questions ahead of time.

That's fair, I guess. I don't think we need to fully spell out the answer to each of these questions. But I think we should have some general alignment on how we'll handle the last non-Rust release, and what some guarantees are that we can and want to provide.

Quoted 7 lines

The answer to all of them is
probably "we'll weigh the severity of the issue and the cost to backport and give the last C-only version significant extra weight in our considerations". I doubt we'll ever be able to promise any more detail than that until we get concrete cases; I'm not even sure that this statement is acceptable to everyone on the list from the overpromising angle despite being as incomplete as it is.

True, we don't want to overburden us, either. This is mostly why I proposed the compromise of saying "We provide you with updates for the LTS version for X amount of time. If you still depend on it after that time, we will be happy to pass over maintainership of that branch to the community."

[snip]

Quoted 9 lines

I still don't see why distributors _must_ ship the latest version of Git and why folks on some platforms are considered broken if they are using a slightly older version. Let me ask again: has anyone answered why this is considered mandatory? If they have, I've missed it, but I've asked multiple times. Even if you want to lump "distributors cannot build a newer version" under the umbrella of "breaking changes", I argue it's a much different kind of break and one which merits different timelines for handling than e.g. lumping it in with 3.0.

To me it's not necessarily about the _latest_ version, rather about _any_ version. Some distributions will not be able to build Git at all anymore, so they are stuck at the last non-Rust version for the time being. And seeing that the timeline is years for them to get Rust support they may not be on a slightly older version, but on an ancient version eventually.

So the question to me is less whether users of that distro will miss out on new features, which I think is acceptable. Hence my statement that it is fine from my point of view for new features to be written in Rust immediately.

NB: There's some nuance here. If newer features mean that users cannot interact with modern upstreams anymore the picture would change quite significantly. But the only work that really comes to my mind is SHA256, which already exists. I don't know whether the interop code may fall into this category, I hope it doesn't.

But the bigger question is whether that old version still gets security updates and important bug fixes. If the only available non-Rust version is riddled with security holes then these distros won't be able to provide it at all anymore.

Quoted 10 lines
Quoted 9 lines
Quoted 4 lines

(4) you suggest that adding Rust as an optional component should avoid the problem, yet we've already had Rust as an optional component for the last three releases, going back to 2.49.0. (libgit-rs and libgit-sys).

I don't really think that either libgit-rs or libgit-sys help in any way. These are part of "contrib/", not built by default, and neither are they consumed by anyone out there. So there is no reason for anyone to build that library to the best of my knowledge.

Quoted 10 lines

I'm fully willing to accept they are inadequate notice (and perhaps even barely helpful), but disagree with the characterization that they don't help at all:
* they were consumed in the past by Google
* they recently received patches from someone outside Google
(https://lore.kernel.org/git/[email protected]/)
* they were mentioned in the release notes highlighting at a minimum
that Rust is being added to Git.
* they were highlighted in blog posts from both GitLab and GitHub as
being noteworthy new things in the v2.49.0 release

Okay, fair.

Quoted 6 lines

I agree with you there is certainly more we can do, and I like your idea of a test ballon. Let's just avoid repeating the problem of adding an optional component that no one will try to build except for those for whom we know can build it; doing that would provide no more notice and thus provide no incremental benefit over libgit-rs and libgit-sys.

Fully agreed. My current proposal includes several steps of how we tighten the screws here, where we gradually start to require Rust by default on more platforms. Before Git 3.0 it's still possible to opt out, but eventually distributors need to opt out explicitly. So that should hopefully alert them that something is cooking.

Patrick

#176 lore raw

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

In reply to Junio C Hamano
Quoted 13 lines · Junio C Hamano
Quoted 7 lines · Phillip Wood

3) There is a period of a small number of years where we continue to provide security updates for a version of git that can be built without rust. This is intended to allow a realistic time for distributors on platforms without a rust compiler to port one or make other arrangements for providing future security updates without placing an undue burden on the project to provide security updates for niche platforms indefinitely.

I am not willing to see such a support for multiple years, though. If the first item is 6 months, this backporting stale releases should be on the same order of timeperiod.

Quoted 7 lines

If it were "3 years of optional period, 18 months of backporting security updates", I would find it more realistic. It would give those platform maintainers enough time to robby, fundraise, or otherwise campaign to bring Rust on their system. I personally find that 6 months is way too short (if we are _only_ looking for an excuse to say "we have given them ample time to react, and now it is their problem", 6 months may be good enough, though).

Yeah, I also think that six months is a bit short, but three years on the other hand feels like it will cause quite some pain on our side. My plan is shooting for roughly one year of optional support, which is still way shorter than the three years you mention.

How would you feel about:

- Pinning a date for Git 3.0 at the end of next year and tying mandatory Rust to it.

- Guaranteeing at least one year of security backports for 2.99 (or whatever the last release before Git 3.0 is).

- Explicitly stating that if anybody requires to maintain that version afterwards, we are happy to let the community maintain that branch going forward.

That means that we stop supporting 2.99 in a bit more than ~two years from now, but we don't fully close the door on it if people still rely on it.

Patrick

#162 lore raw

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

In reply to [email protected]

Hi Randall

Quoted 14 lines · On 07/09/2025 17:09, [email protected] wrote:
Quoted 2 lines · Elijah Newren

Sorry for the delay; life outside of work is challenging at the moment...

I am going to address the critical point mentioned below and snip the rest for brevity.

Quoted 7 lines

I still don't see why distributors _must_ ship the latest version of Git and why folks on some platforms are considered broken if they are using a slightly older version. Let me ask again: has anyone answered why this is considered mandatory? If they have, I've missed it, but I've asked multiple times. Even if you want to lump "distributors cannot build a newer version" under the umbrella of "breaking changes", I argue it's a much different kind of break and one which merits different timelines for handling than e.g. lumping it in with 3.0.

Quoted 10 lines

I do not see that distributors _must_ ship the latest version. Suppose we are on 2.51.0 and a CVE comes out that prohibits its use in an organization that does not allow any medium-high to high CVEs. This represents hundreds of thousands of impacted users in my community alone. How does the CVE get applied if the latest cannot be built and the git team does not apply the CVE fixes to old versions. Personally, I do not care if git versions are different between work and home, or even between CI/CD and other platforms. I don't even care if I have to use JGit instead of git in some situations (which I see is a likely outcome of this discussion). Is there an official statement of what an LTS means?

We're currently discussing what promises we can make about supporting a non-rust version of git.

Quoted 1 line

In other projects LTS is typically, and formally by policy 5 years.

I know commercial linux distributions offer that kind of support but are there really open source projects that guarantee 5 years of security updates without any kind of support contract?

Quoted 2 lines

From what others have said here, positions of 6 months, 3 years, and
"apply it yourself if you want to continue to use git" have been made.

Yes it is still being discussed, and no one is volunteering to offer five years of support.

Quoted 7 lines

The core problem of adding a breaking dependency is when a CVE comes out that prohibits git from being used at all. If the git team is not going to provide a clear statement, one way or another, if how CVEs (at whatever severity level) will not have a commitment of any kind, then distributors are essentially cast adrift and on our own. It would be helpful of those of us who donate our time, for no compensation, are able to plan for this in a meaningful way.

Doesn't your company make a front end to git? Are you saying that the management does not allocate any staff time to work on git itself and expects the community to provide it with free security updates?

Quoted 3 lines

Please remember that
we have to justify our participation to our management teams to be allowed to continue to participate.

I'm confused by this, as the sentence before say's you're donating your time for no compensation.

Quoted 5 lines

Nothing is free from this end
and if fixing (not just applying fixes) CVEs are now 100% our responsibility, if would be critical to know that when we build our business cases to our bosses, who I am fairly certain will say an emphatic no.

In the long term, unless your platform gains a rust compiler I'm afraid I think that is most likely outcome.

Quoted 3 lines

Also remember that without support from the git team, the code base is no longer the same, meaning the auditors will not necessarily accept fixes from third-party sources.

I think I saw a suggestion/question about the possibility of hosting any long term support branch that is maintained by interested parties within the main repository. Would that help?

I appreciate that any move to rust would be very disappointing and disruptive to you but the community has to weigh up the benefits rust has to offer against that.

Phillip

Quoted 14 lines

This particular
point enabled adoption on some platforms, particularly NonStop. Adoption was at 1-2 customers when we had a divergent code based because some platform fixes being different from the standard code-base and could not be certified as valid. Once the code-base because common, adoption was rapid and enthusiastic. If this goes away, I suspect that adoption rates will go negative. I am aware that that particular discussion is actually happening in some organizations in my community right now, with companies looking for alternatives to git based on this discussion thread.

With over a decade of respect and participation,
Randall

#164 lore raw

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

In reply to [email protected]
Quoted 15 lines · On Sun, Sep 7, 2025 at 10:10 AM <[email protected]> wrote:
Quoted 2 lines · Elijah Newren

Sorry for the delay; life outside of work is challenging at the moment...

I am going to address the critical point mentioned below and snip the rest for brevity.

Quoted 7 lines

I still don't see why distributors _must_ ship the latest version of Git and why folks on some platforms are considered broken if they are using a slightly older version. Let me ask again: has anyone answered why this is considered mandatory? If they have, I've missed it, but I've asked multiple times. Even if you want to lump "distributors cannot build a newer version" under the umbrella of "breaking changes", I argue it's a much different kind of break and one which merits different timelines for handling than e.g. lumping it in with 3.0.

Quoted 8 lines

I do not see that distributors _must_ ship the latest version. Suppose we are on 2.51.0 and a CVE comes out that prohibits its use in an organization that does not allow any medium-high to high CVEs. This represents hundreds of thousands of impacted users in my community alone. How does the CVE get applied if the latest cannot be built and the git team does not apply the CVE fixes to old versions. Personally, I do not care if git versions are different between work and home, or even between CI/CD and other platforms. I don't even care
...

Ok, that answers the question for NonStop, but that doesn't answer the question for the plethora of other distributions. Most distributions don't ship the latest version of Git in their package manager, and if an organization deems it critical to have the latest they can build it themselves and ignore the Git version in the package manager. So why does Windows, Mac, Linux, etc... _need_ the latest version of Git in the package manager?

If security updates are backported to NonStop, until that platform supports Rust, then I don't see why using an older version of Git in Windows, Mac, Linux, etc... is a catastrophe. Most existing distributions _can_ package the latest version of Git, but they _don't_.

I reiterate Elijah's question "Why _must_ distributors ship the latest version of Git?".

#166 lore raw

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

In reply to [email protected]
Quoted 55 lines · On Sun, Sep 7, 2025 at 9:10 AM <[email protected]> wrote:
Quoted 2 lines · Elijah Newren

Sorry for the delay; life outside of work is challenging at the moment...

I am going to address the critical point mentioned below and snip the rest for brevity.

Quoted 7 lines

I still don't see why distributors _must_ ship the latest version of Git and why folks on some platforms are considered broken if they are using a slightly older version. Let me ask again: has anyone answered why this is considered mandatory? If they have, I've missed it, but I've asked multiple times. Even if you want to lump "distributors cannot build a newer version" under the umbrella of "breaking changes", I argue it's a much different kind of break and one which merits different timelines for handling than e.g. lumping it in with 3.0.

I do not see that distributors _must_ ship the latest version. Suppose we are on 2.51.0 and a CVE comes out that prohibits its use in an organization that does not allow any medium-high to high CVEs. This represents hundreds of thousands of impacted users in my community alone. How does the CVE get applied if the latest cannot be built and the git team does not apply the CVE fixes to old versions. Personally, I do not care if git versions are different between work and home, or even between CI/CD and other platforms. I don't even care if I have to use JGit instead of git in some situations (which I see is a likely outcome of this discussion). Is there an official statement of what an LTS means? In other projects LTS is typically, and formally by policy 5 years. From what others have said here, positions of 6 months, 3 years, and "apply it yourself if you want to continue to use git" have been made.

The core problem of adding a breaking dependency is when a CVE comes out that prohibits git from being used at all. If the git team is not going to provide a clear statement, one way or another, if how CVEs (at whatever severity level) will not have a commitment of any kind, then distributors are essentially cast adrift and on our own. It would be helpful of those of us who donate our time, for no compensation, are able to plan for this in a meaningful way. Please remember that we have to justify our participation to our management teams to be allowed to continue to participate. Nothing is free from this end and if fixing (not just applying fixes) CVEs are now 100% our responsibility, if would be critical to know that when we build our business cases to our bosses, who I am fairly certain will say an emphatic no.

Also remember that without support from the git team, the code base is no longer the same, meaning the auditors will not necessarily accept fixes from third-party sources. This particular point enabled adoption on some platforms, particularly NonStop. Adoption was at 1-2 customers when we had a divergent code based because some platform fixes being different from the standard code-base and could not be certified as valid. Once the code-base because common, adoption was rapid and enthusiastic. If this goes away, I suspect that adoption rates will go negative. I am aware that that particular discussion is actually happening in some organizations in my community right now, with companies looking for alternatives to git based on this discussion thread.

Quoted 2 lines

With over a decade of respect and participation,
Randall

Thanks, Randall, this is useful information. In regards to one point not fully covered by Phillip:

Quoted 3 lines

Also remember that without support from the git team, the code base is no longer the same, meaning the auditors will not necessarily accept fixes from third-party sources.

Why does it need to be "third-party" sources? Linus years ago blessed having someone else be in charge of providing updates for stable releases of Linux. Junio could do the same with Git and similarly mark an individual or group of people as the maintainers for the last Rust-optional version of Git, and those individuals could make official releases of Git with extended security fix support. Then it's not every platform repeating the backporting work that needs to be done, but rather individuals from the affected platform(s) collaborating on that work and then making official first-party releases.

#163 lore raw

RE: [PATCH v3 02/15] xdiff: introduce rust

In reply to Phillip Wood
Quoted 30 lines · Phillip Wood
Quoted 5 lines · On 07/09/2025 17:09, [email protected] wrote:
Quoted 2 lines · Elijah Newren

Sorry for the delay; life outside of work is challenging at the moment...

I am going to address the critical point mentioned below and snip the rest for

brevity.

Quoted 3 lines
Quoted 3 lines

I still don't see why distributors _must_ ship the latest version of Git and why folks on some platforms are considered broken if they are using a

slightly older version.

Quoted 5 lines
Quoted 5 lines

Let me ask again: has anyone answered why this is considered mandatory? If they have, I've missed it, but I've asked multiple times. Even if you want to lump "distributors cannot build a newer version" under the umbrella of "breaking changes", I argue it's a much different kind of break and one which merits different timelines for

handling than e.g. lumping it in with 3.0.

Quoted 12 lines

I do not see that distributors _must_ ship the latest version. Suppose we are on
2.51.0 and a CVE comes out that prohibits its use in an organization that does not allow any medium-high to high CVEs. This represents hundreds of thousands of impacted users in my community alone. How does the CVE get applied if the latest cannot be built and the git team does not apply the CVE fixes to old versions. Personally, I do not care if git versions are different between work and home, or even between CI/CD and other platforms. I don't even care if I have to use JGit instead of git in some situations (which I see is a likely outcome of this discussion). Is there an official statement of what an LTS means?

Quoted 8 lines

We're currently discussing what promises we can make about supporting a non-rust version of git.

Quoted 1 line

In other projects LTS is typically, and formally by policy 5 years.

I know commercial linux distributions offer that kind of support but are there really open source projects that guarantee 5 years of security updates without any kind of support contract?

OpenSSL provides 5 years of security fix support (at no cost) for LTS designated releases. Currently 3.0 ending Sept 2026 and 3.5 ending around October 2030. After those dates, there is a fee-based support arrangement available.

Quoted 14 lines
Quoted 2 lines

From what others have said here, positions of 6 months, 3 years, and
"apply it yourself if you want to continue to use git" have been made.

Yes it is still being discussed, and no one is volunteering to offer five years of support.

Quoted 7 lines

The core problem of adding a breaking dependency is when a CVE comes out that prohibits git from being used at all. If the git team is not going to provide a clear statement, one way or another, if how CVEs (at whatever severity level) will not have a commitment of any kind, then distributors are essentially cast adrift and on our own. It would be helpful of those of us who donate our time, for no compensation, are able to plan for this in a meaningful way.

Quoted 3 lines

Doesn't your company make a front end to git? Are you saying that the management does not allocate any staff time to work on git itself and expects the community to provide it with free security updates?

The REAL PROBLEM that is not being addressed in this thread is that large companies (the ones who process your credit cards, build your cars, manufacture your drugs, and tool your factories (a.k.a. NonStop customers), are generally unwilling to accept CVE fixes from third parties. The fixes have to be part of the official code base or the fixes will not accepted. That means that either:

1. the git team has to officially sanction the fixes; or

2. do the fixes themselves.

A compromise may be possible to keep a support branch around in the official git repo, for those of us who do not have rust available to contribute to, specifically for post C-deprecation CVE fixes, but I am not sure this is practical. It would also require occasional assistance from the git team, to make sense of some of the fixes, If they apply, as none of us are rust experts.

I am already allocated to spending between 10 and 20 hours a month to git, which usually involves running and verifying build/test cycles. Since git tests are flakey, in some cases, I have to manually examine each failure situation and decide whether the failures are sufficient to pass the releases. These have been reported previously without resolution and do not bear discussion here.

It is important to understand that many git customers in high audit situations build git on their own because they do not trust third party builds, so this needs to remain an option.

Quoted 5 lines
Quoted 3 lines

Please remember that
we have to justify our participation to our management teams to be allowed to continue to participate.

I'm confused by this, as the sentence before say's you're donating your time for no compensation.

My company pretends to donates my time with very little direct benefit to them. My participation is because I feel it is important for my community. No, I do not get a salary for my git time. It is evenings and weekends. Any time I spend during working hours has to be made up during off hours.

Quoted 10 lines
Quoted 6 lines

Nothing is free from this end
and if fixing (not just applying fixes) CVEs are now 100% our responsibility, if would be critical to know that when we build our business cases to our bosses, who I am fairly certain will say an emphatic no.

In the long term, unless your platform gains a rust compiler I'm afraid I think that is most likely outcome.

Quoted 7 lines
Quoted 3 lines

Also remember that without support from the git team, the code base is no longer the same, meaning the auditors will not necessarily accept fixes from third-party sources.

I think I saw a suggestion/question about the possibility of hosting any long term support branch that is maintained by interested parties within the main repository. Would that help?

DEFINITELY. With assistance as above. With some help, we may be able to make this work. It might require a deeper participation on my part and those on my team to approve changes, which we would consider.

Quoted 2 lines

I appreciate that any move to rust would be very disappointing and disruptive to you but the community has to weigh up the benefits rust has to offer against that.

The community has plans for Rust but they have not taken shape fully as of yet. I have personally been badgering product management to make this happen, and I might know more in a month or so. However, this takes time, and 6 months is not enough.

--Randall

#167 lore raw

RE: [PATCH v3 02/15] xdiff: introduce rust

In reply to Elijah Newren
Quoted 70 lines · Elijah Newren
Quoted 6 lines · On Sun, Sep 7, 2025 at 9:10 AM <[email protected]> wrote:
Quoted 2 lines · Elijah Newren

Sorry for the delay; life outside of work is challenging at the moment...

I am going to address the critical point mentioned below and snip the rest for

brevity.

Quoted 3 lines
Quoted 3 lines

I still don't see why distributors _must_ ship the latest version of Git and why folks on some platforms are considered broken if they are using a

slightly older version.

Quoted 5 lines
Quoted 5 lines

Let me ask again: has anyone answered why this is considered mandatory? If they have, I've missed it, but I've asked multiple times. Even if you want to lump "distributors cannot build a newer version" under the umbrella of "breaking changes", I argue it's a much different kind of break and one which merits different timelines for

handling than e.g. lumping it in with 3.0.

Quoted 12 lines

I do not see that distributors _must_ ship the latest version. Suppose we are on
2.51.0 and a CVE comes out that prohibits its use in an organization that does not allow any medium-high to high CVEs. This represents hundreds of thousands of impacted users in my community alone. How does the CVE get applied if the latest cannot be built and the git team does not apply the CVE fixes to old versions. Personally, I do not care if git versions are different between work and home, or even between CI/CD and other platforms. I don't even care if I have to use JGit instead of git in some situations (which I see is a likely outcome of this discussion). Is there an official statement of what an LTS means?

In other projects LTS is typically, and formally by policy 5 years.

Quoted 30 lines

From what others have said here, positions of 6 months, 3 years, and "apply it yourself if you want to continue to use git" have been made.

The core problem of adding a breaking dependency is when a CVE comes out that prohibits git from being used at all. If the git team is not going to provide a clear statement, one way or another, if how CVEs (at whatever severity level) will not have a commitment of any kind, then distributors are essentially cast adrift and on our own. It would be helpful of those of us who donate our time, for no compensation, are able to plan for this in a meaningful way. Please remember that we have to justify our participation to our management teams to be allowed to continue to participate. Nothing is free from this end and if fixing (not just applying fixes) CVEs are now 100% our responsibility, if would be critical to know that when we build our business cases to our bosses, who I am fairly certain will say an emphatic no.

Also remember that without support from the git team, the code base is no longer the same, meaning the auditors will not necessarily accept fixes from third-party sources. This particular point enabled adoption on some platforms, particularly NonStop.
Adoption was at 1-2 customers when we had a divergent code based because some platform fixes being different from the standard code-base and could not be certified as valid. Once the code-base because common, adoption was rapid and enthusiastic.
If this goes away, I suspect that adoption rates will go negative. I am aware that that particular discussion is actually happening in some organizations in my community right now, with companies looking for alternatives to git based on this discussion thread.

Quoted 1 line

With over a decade of respect and participation, Randall

Thanks, Randall, this is useful information. In regards to one point not fully covered by Phillip:

Quoted 3 lines

Also remember that without support from the git team, the code base is no longer the same, meaning the auditors will not necessarily accept fixes from third-party sources.

Quoted 8 lines

Why does it need to be "third-party" sources? Linus years ago blessed having someone else be in charge of providing updates for stable releases of Linux. Junio could do the same with Git and similarly mark an individual or group of people as the maintainers for the last Rust-optional version of Git, and those individuals could make official releases of Git with extended security fix support. Then it's not every platform repeating the backporting work that needs to be done, but rather individuals from the affected platform(s) collaborating on that work and then making official first-party releases.

Linux has one set of rules, and other platforms have others. I do not define the audit requirements for PCI, SWIFT, or HIPPA compliance (and other rules outside of North America), which apply one way or another to most of my community. The audit teams, which are both internal to the companies and at governmental regulatory levels, do this. It is 100% out of my control but is a reality. Fixes to any code involved in managing financial and health instruments must be done by authorized and recognized sources. I am not one of them.

#165 lore raw

RE: [PATCH v3 02/15] xdiff: introduce rust

In reply to Ezekiel Newren
Quoted 36 lines · Ezekiel Newren
Quoted 6 lines · On Sun, Sep 7, 2025 at 10:10 AM <[email protected]> wrote:
Quoted 2 lines · Elijah Newren

Sorry for the delay; life outside of work is challenging at the moment...

I am going to address the critical point mentioned below and snip the rest for

brevity.

Quoted 3 lines
Quoted 3 lines

I still don't see why distributors _must_ ship the latest version of Git and why folks on some platforms are considered broken if they are using a

slightly older version.

Quoted 5 lines
Quoted 5 lines

Let me ask again: has anyone answered why this is considered mandatory? If they have, I've missed it, but I've asked multiple times. Even if you want to lump "distributors cannot build a newer version" under the umbrella of "breaking changes", I argue it's a much different kind of break and one which merits different timelines for

handling than e.g. lumping it in with 3.0.

Quoted 10 lines

I do not see that distributors _must_ ship the latest version. Suppose we are on
2.51.0 and a CVE comes out that prohibits its use in an organization that does not allow any medium-high to high CVEs. This represents hundreds of thousands of impacted users in my community alone. How does the CVE get applied if the latest cannot be built and the git team does not apply the CVE fixes to old versions. Personally, I do not care if git versions are different between work and home, or even between CI/CD and other platforms. I don't even care ...

Ok, that answers the question for NonStop, but that doesn't answer the question for the plethora of other distributions. Most distributions don't ship the latest version of Git in their package manager, and if an organization deems it critical to have the latest they can build it themselves and ignore the Git version in the package manager. So why does Windows, Mac, Linux, etc... _need_ the latest version of Git in the package manager?

Quoted 7 lines

If security updates are backported to NonStop, until that platform supports Rust, then I don't see why using an older version of Git in Windows, Mac, Linux, etc... is a catastrophe. Most existing distributions _can_ package the latest version of Git, but they _don't_.

I reiterate Elijah's question "Why _must_ distributors ship the latest version of Git?".

My emphatic answer is that they do not. There is no requirement from me or anyone I know to ship the latest version. What is crucial is that there be fixes for medium-high and above CVEs that are delivered in 30 days from initial fix availability (that would be in Rust, for this conversation and applied to C). If that were supported, I could live with as would my customers and their auditors for LTS releases. Please see my expectation of LTS defined elsewhere in this thread - essentially 5 years. Perhaps 3 at a bare minimum.

#168 lore raw

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

In reply to [email protected]
Quoted 22 lines · On Mon, Sep 8, 2025 at 8:37 AM <[email protected]> wrote:
Quoted 11 lines · Elijah Newren
Quoted 2 lines · On Sun, Sep 7, 2025 at 9:10 AM <[email protected]> wrote:

On September 7, 2025 12:10 AM, Elijah Newren wrote:

Thanks, Randall, this is useful information. In regards to one point not fully covered by Phillip:

Quoted 3 lines

Also remember that without support from the git team, the code base is no longer the same, meaning the auditors will not necessarily accept fixes from third-party sources.

Quoted 8 lines

Why does it need to be "third-party" sources? Linus years ago blessed having someone else be in charge of providing updates for stable releases of Linux. Junio could do the same with Git and similarly mark an individual or group of people as the maintainers for the last Rust-optional version of Git, and those individuals could make official releases of Git with extended security fix support. Then it's not every platform repeating the backporting work that needs to be done, but rather individuals from the affected platform(s) collaborating on that work and then making official first-party releases.

Quoted 7 lines

Linux has one set of rules, and other platforms have others. I do not define the audit requirements for PCI, SWIFT, or HIPPA compliance (and other rules outside of North America), which apply one way or another to most of my community. The audit teams, which are both internal to the companies and at governmental regulatory levels, do this. It is 100% out of my control but is a reality. Fixes to any code involved in managing financial and health instruments must be done by authorized and recognized sources. I am not one of them.

Perhaps I wasn't clear? Let me try to summarize what I've understood of the conversation:

Randall: We need to have official git releases for the last Rust-optional release.
Elijah: Great! Let's enable interested folks to make official git releases for the last Rust-optional release.
Randall: We need to have official git releases for the last Rust-optional release.

Which makes me just want to repeat what I said last time -- let's enable some folks to do that.

#169 lore raw

RE: [PATCH v3 02/15] xdiff: introduce rust

Quoted 45 lines · Elijah Newren
Quoted 7 lines · On Mon, Sep 8, 2025 at 8:37 AM <[email protected]> wrote:
Quoted 5 lines · Elijah Newren
Quoted 2 lines · On Sun, Sep 7, 2025 at 9:10 AM <[email protected]> wrote:

On September 7, 2025 12:10 AM, Elijah Newren wrote:

Thanks, Randall, this is useful information. In regards to one point not fully

covered

Quoted 8 lines
Quoted 8 lines

by Phillip:

Quoted 3 lines

Also remember that without support from the git team, the code base is no longer the same, meaning the auditors will not necessarily accept fixes from third-party sources.

Why does it need to be "third-party" sources? Linus years ago blessed having someone else be in charge of providing updates for stable releases of Linux.

Junio

Quoted 2 lines
Quoted 2 lines

could do the same with Git and similarly mark an individual or group of people as the maintainers for the last Rust-optional version of Git, and those individuals

could

Quoted 1 line
Quoted 1 line

make official releases of Git with extended security fix support. Then it's not

every

Quoted 11 lines
Quoted 3 lines

platform repeating the backporting work that needs to be done, but rather individuals from the affected platform(s) collaborating on that work and then making official first-party releases.

Linux has one set of rules, and other platforms have others. I do not define the audit requirements for PCI, SWIFT, or HIPPA compliance (and other rules outside of North America), which apply one way or another to most of my community. The audit teams, which are both internal to the companies and at governmental regulatory levels, do this. It is 100% out of my control but is a reality. Fixes to any code involved in managing financial and health instruments must be done by authorized and recognized sources. I am not one of them.

Perhaps I wasn't clear? Let me try to summarize what I've understood of the conversation:

Randall: We need to have official git releases for the last Rust-optional release.
Elijah: Great! Let's enable interested folks to make official git releases for the last Rust-optional release.
Randall: We need to have official git releases for the last Rust-optional release.

Quoted 2 lines

Which makes me just want to repeat what I said last time -- let's enable some folks to do that.

Ok, what does that look like. When and how? Will I get added to the list of committers for this? How many people? Starting when, ending when? It would be very nice to have some kind of project plan for this with dependencies and milestones - I have been asking. If someone sends me a list, I can start officially tracking it.

#42 lore raw

gitoxide-compatible licensing of Git's Rust code, was Re: [PATCH 6/7] xdiff: conditionally use Rust's implementation of xxhash

In reply to Phillip Wood

Hi Phillip,

Quoted 23 lines · Phillip Wood

Hi Johannes

Quoted 20 lines · Johannes Schindelin

Hi Ezekiel,

rust/xdiff/src/lib.rs line 7

Quoted 12 lines · Ezekiel Newren via GitGitGadget
rust/xdiff/src/lib.rs +7 -0
index e69de29bb2d1..96975975a1ba 100644
@@ -0,0 +1,7 @@
+
+
+#[no_mangle]
+unsafe extern "C" fn xxh3_64(ptr: *const u8, size: usize) -> u64 {
+    let slice = std::slice::from_raw_parts(ptr, size);
+    xxhash_rust::xxh3::xxh3_64(slice)
+}

I know that this is a pretty small file, but I do notice that it does not have a license header.

Quoted 8 lines
Quoted 3 lines

This reminds me of the unfortunate oversight to be careful about making (and keeping) libgit.a's source files compatible with libgit2's license to nurture a fruitful exchange between those two projects.

I'm not sure I follow your reasoning here. libgit2 was started after git and chose to use an incompatible license. I wasn't around at the time but isn't there a list of git contributors who are happy to re-license their contributions with the linking exception used by libgit2?

Let me provide some historical context that might clarify the licensing concern.

When libgit2 was created, the goal was to demonstrate that Git functionality could be packaged as a reusable library, inviting innovation via 3rd-party products. The project took existing Git code (with permission) and wrapped it with a proper API. The hope was that this would eventually become the foundation for Git itself.

What we learned from that experience is instructive: license incompatibility became an insurmountable barrier to code sharing between the projects.

Lack of functionality prevented commercial products using libgit2 to provide powerful user interfaces that outshine Git's own user experience, unless they accepted the limited functionality.

Even when volunteers wanted to port new Git features to libgit2, the licensing prevented it.

This fragmentation weakened both projects - libgit2 couldn't benefit from Git's innovations, and Git couldn't leverage libgit2's API improvements nor corporate contributions that would have been more likely to target libgit2 than Git.

You can see this in full action: merge ORT, partial clone, sparse index, etc. All of those features are missing from libgit2, with little hope to end up otherwise.

Innovations such as geographically-distributed, redundant data stores, or Xet-like big-file storage to replace e.g. Git LFS with a fully native solution, haven't happened, despite libgit2's architecture offering the extensibility and proper delineation to make such improvements cleaner and much more straight-forward than Git's own source code would allow.

Quoted 10 lines
Quoted 9 lines

With Rust, we still have a really good chance to learn from history and avoid that mistake: Gitoxide is a very exciting project with clear overlap in its mission to implement Git functionality in Rust. Gitoxide is dual-licensed under the Apache License v2 and the MIT license (see
https://github.com/GitoxideLabs/gitoxide?tab=readme-ov-file#license).

Would you mind adding a license header to that file that explicitly allows the contents of the file to be used in Gitoxide, to get the Rust effort started on a good foot?

Quoted 5 lines

I wary of that for two reasons. Firstly over time it is de-facto re-licensing git as the amount of rust code grows and the amount of C code shrinks which deserves a wider discussion. Secondly it makes it harder to convert our C code which is licensed under GPL2 (or in the case of xdiff LGPL) to rust if the rust code uses a different license.

The industry adopted libgit2 widely precisely because it provided what Git didn't: a clean API for building tools. But the licensing barrier meant that innovation had to happen in isolation.

Due to the feature disparity, we saw "libgit2 evacuation" efforts, starting with Visual Studio, later GitHub and GitLab followed, where work was duplicated by moving away from libgit2 towards a distinctly non-API way to invoke Git functionality: by spawning full-blown git processes and communicating by parsing stdout, risking regressions due to typo fixes such as the infamous "up-to-date -> up to date" patches. Such a lot of extra work, away from proper API calls, just because of that fragmentation!

With Rust and Gitoxide, we have a rare opportunity to avoid this fragmentation from the start. Gitoxide's permissive dual licensing means code can flow both ways. This isn't about "slipping in" a license change - it's about learning from what happened before.

By the way, you made it sound as if I asked to re-license existing code, which is not the case. I specifically asked for new code to be licensed in a way that avoids to straight up prevent collaboration with the Gitoxide project from the get-go.

It would not even take more than something as simple as GPLv2+exception. We do have prior art for that: The Git project itself suggests in its very own COPYING file to use the following license in new files:

This file is licensed under the GPL v2, or a later version at the discretion of Linus.

Note the exception? For new Rust code (and of course excluding code that has been ported verbatim from GPLv2-licensed code), GPL v2 could be used with an exception along these lines: This file is licensed under the GPL v2, with the exception that it can be freely used in the Gitoxide project.

I am not a lawyer (which everybody but laywers are nowadays required to say), therefore this likely needs some tweaking.

Quoted 4 lines

If someone wants to start a discussion about re-licensing git (and is prepared to do all of the associated admin in the event that it happens) then by all means do so but I don't think it we want to slip such a change into this series.

The "wider discussion" you mention is exactly what we need; Starting with compatible licensing makes that discussion possible rather than purely theoretical and moot.

Ciao,
Johannes

#43 lore raw

Re: gitoxide-compatible licensing of Git's Rust code, was Re: [PATCH 6/7] xdiff: conditionally use Rust's implementation of xxhash

Quoted 11 lines · Johannes Schindelin

It would not even take more than something as simple as GPLv2+exception. We do have prior art for that: The Git project itself suggests in its very own COPYING file to use the following license in new files:

This file is licensed under the GPL v2, or a later version at the discretion of Linus.

Note the exception? For new Rust code (and of course excluding code that has been ported verbatim from GPLv2-licensed code), GPL v2 could be used with an exception along these lines: This file is licensed under the GPL v2, with the exception that it can be freely used in the Gitoxide project.

I think this "and of course" parenthetical might be a sticking point. Obviously taking the code verbatim and re-licensing it is not allowed. But I think even reading the C code and then writing substantially similar Rust code may be legally questionable. The Rust code under the more permissive license has to either be clean-room, or have permission for re-licensing from the original authors (which is getting to be all but impossible over time as code ends up being touched by many people).

I think this is the same issue that libgit2 ran into. If it were just a matter of porting over and re-writing new features, more of it would have been done. But for code to come under the new license it can't just be a port, but has to be an independent work.

So I wonder if this just creates the same awkward silo between Git's Rust code and its C code (that we already have between Git and libgit2).

Quoted 2 lines

I am not a lawyer (which everybody but laywers are nowadays required to say), therefore this likely needs some tweaking.

Me either. I do like the goal you're trying to accomplish, but I worry that it will end up causing headaches down the line. Even if we, the developers, are a bit permissive about what constitutes "porting" and don't require a clean-room implementation, this kind of thing scares off the legal teams that approve using the Rust modules in bigger projects. IIRC Microsoft put in a big effort into vetting libgit2's provenance before agreeing to use it in Visual Studio.

-Peff

#44 lore raw

Re: gitoxide-compatible licensing of Git's Rust code, was Re: [PATCH 6/7] xdiff: conditionally use Rust's implementation of xxhash

Quoted 22 lines · Jeff King
Quoted 11 lines · Johannes Schindelin

It would not even take more than something as simple as GPLv2+exception. We do have prior art for that: The Git project itself suggests in its very own COPYING file to use the following license in new files:

This file is licensed under the GPL v2, or a later version at the discretion of Linus.

Note the exception? For new Rust code (and of course excluding code that has been ported verbatim from GPLv2-licensed code), GPL v2 could be used with an exception along these lines: This file is licensed under the GPL v2, with the exception that it can be freely used in the Gitoxide project.

I think this "and of course" parenthetical might be a sticking point. Obviously taking the code verbatim and re-licensing it is not allowed. But I think even reading the C code and then writing substantially similar Rust code may be legally questionable. The Rust code under the more permissive license has to either be clean-room, or have permission for re-licensing from the original authors (which is getting to be all but impossible over time as code ends up being touched by many people).

Quoted 4 lines

I think this is the same issue that libgit2 ran into. If it were just a matter of porting over and re-writing new features, more of it would have been done. But for code to come under the new license it can't just be a port, but has to be an independent work.

Thanks for putting this so clearly, I agree with everything that you've written here. Another thing I'm concerned/confused about is how the exception for a single project works in practice. Does it mean that a third party that wants to re-use some code from GitOxide has to check if the code originally came from Git to determine which license it is under? Or does it mean that anyone who wants to use Git's code without the copyleft restrictions can do so if they launder it through GitOxide first? Neither of those seems like a great outcome.

Thanks

Phillip

#45 lore raw

Re: gitoxide-compatible licensing of Git's Rust code, was Re: [PATCH 6/7] xdiff: conditionally use Rust's implementation of xxhash

Quoted 8 lines · Phillip Wood

Thanks for putting this so clearly, I agree with everything that you've written here. Another thing I'm concerned/confused about is how the exception for a single project works in practice. Does it mean that a third party that wants to re-use some code from GitOxide has to check if the code originally came from Git to determine which license it is under? Or does it mean that anyone who wants to use Git's code without the copyleft restrictions can do so if they launder it through GitOxide first? Neither of those seems like a great outcome.

If I understand the suggestion correctly, it's not to license it specifically to GitOxide. It's to use a permissive license (like GPL with linking exception) that would make it compatible with other projects with similar licenses (like GitOxide).

-Peff

#46 lore raw

Re: gitoxide-compatible licensing of Git's Rust code, was Re: [PATCH 6/7] xdiff: conditionally use Rust's implementation of xxhash

Quoted 11 lines · Jeff King
Quoted 8 lines · Phillip Wood

Thanks for putting this so clearly, I agree with everything that you've written here. Another thing I'm concerned/confused about is how the exception for a single project works in practice. Does it mean that a third party that wants to re-use some code from GitOxide has to check if the code originally came from Git to determine which license it is under? Or does it mean that anyone who wants to use Git's code without the copyleft restrictions can do so if they launder it through GitOxide first? Neither of those seems like a great outcome.

Quoted 4 lines

If I understand the suggestion correctly, it's not to license it specifically to GitOxide. It's to use a permissive license (like GPL with linking exception) that would make it compatible with other projects with similar licenses (like GitOxide).

Yeah, we certainly shouldn't single out a specific project from my point of view. But going with something like LGPL or GPL with linking exception would be quite a sensible choice from my point of view.

I cannot really say much about the concerns. Should we maybe ask the SFC for some guidance here?

Patrick

#47 lore raw

Re: gitoxide-compatible licensing of Git's Rust code, was Re: [PATCH 6/7] xdiff: conditionally use Rust's implementation of xxhash

In reply to Jeff King
Quoted 11 lines · Jeff King
Quoted 8 lines · Phillip Wood

Thanks for putting this so clearly, I agree with everything that you've written here. Another thing I'm concerned/confused about is how the exception for a single project works in practice. Does it mean that a third party that wants to re-use some code from GitOxide has to check if the code originally came from Git to determine which license it is under? Or does it mean that anyone who wants to use Git's code without the copyleft restrictions can do so if they launder it through GitOxide first? Neither of those seems like a great outcome.

Quoted 4 lines

If I understand the suggestion correctly, it's not to license it specifically to GitOxide. It's to use a permissive license (like GPL with linking exception) that would make it compatible with other projects with similar licenses (like GitOxide).

I was responding to this paragraph in Johannes' message

Note the exception? For new Rust code (and of course excluding code that has been ported verbatim from GPLv2-licensed code), GPL v2 could be used with an exception along these lines: This file is licensed under the GPL v2, with the exception that it can be freely used in the Gitoxide project.

That suggestion is pretty close to what libgit2 has in its git.git-authors file[1]. I'm not sure how practical it is to special case just one project though.

Thanks

Phillip

[1] https://github.com/libgit2/libgit2/blob/main/git.git-authors

#48 lore raw

Re: gitoxide-compatible licensing of Git's Rust code, was Re: [PATCH 6/7] xdiff: conditionally use Rust's implementation of xxhash

Quoted 13 lines · Phillip Wood
Quoted 4 lines

If I understand the suggestion correctly, it's not to license it specifically to GitOxide. It's to use a permissive license (like GPL with linking exception) that would make it compatible with other projects with similar licenses (like GitOxide).

I was responding to this paragraph in Johannes' message

Note the exception? For new Rust code (and of course excluding code that has been ported verbatim from GPLv2-licensed code), GPL v2 could be used with an exception along these lines: This file is licensed under the GPL v2, with the exception that it can be freely used in the Gitoxide project.

Quoted 3 lines

That suggestion is pretty close to what libgit2 has in its git.git-authors file[1]. I'm not sure how practical it is to special case just one project though.

Ah, yeah, I may have misunderstood the proposal then.

I don't think that really changes much with respect to my concern, which is for existing code. That probably needs to be explicitly granted permission to relicense, whether to a specific project or not, and it is hard to pinpoint a definitive author for a lot of it (even if many authors have agreed to relicensing) because it has been touched by so many people over the years.

So there are probably two separate legal issues to consider:

- how the explicit re-licensing grant is worded

- what problems may came up with porting existing code that has been touched by many people

-Peff

#49 lore raw

Re: gitoxide-compatible licensing of Git's Rust code, was Re: [PATCH 6/7] xdiff: conditionally use Rust's implementation of xxhash

Quoted 15 lines · Jeff King
Quoted 13 lines · Phillip Wood
Quoted 4 lines

If I understand the suggestion correctly, it's not to license it specifically to GitOxide. It's to use a permissive license (like GPL with linking exception) that would make it compatible with other projects with similar licenses (like GitOxide).

I was responding to this paragraph in Johannes' message

Note the exception? For new Rust code (and of course excluding code that has been ported verbatim from GPLv2-licensed code), GPL v2 could be used with an exception along these lines: This file is licensed under the GPL v2, with the exception that it can be freely used in the Gitoxide project.

Quoted 8 lines
Quoted 3 lines

That suggestion is pretty close to what libgit2 has in its git.git-authors file[1]. I'm not sure how practical it is to special case just one project though.

Ah, yeah, I may have misunderstood the proposal then.

I don't think that really changes much with respect to my concern, which is for existing code.

I agree it doesn't change anything with regard to that, I think it just adds more potential problems.

Quoted 6 lines

That probably needs to be explicitly granted
permission to relicense, whether to a specific project or not, and it is hard to pinpoint a definitive author for a lot of it (even if many authors have agreed to relicensing) because it has been touched by so many people over the years.

Quoted 6 lines

So there are probably two separate legal issues to consider:

- how the explicit re-licensing grant is worded

- what problems may came up with porting existing code that has been touched by many people

If we want to seriously consider this we should probably reach out to Conservancy for some advice. Did this end up being discussed at the Contributor's Summit?

Thanks

Phillip

#52 lore raw

Re: [PATCH 6/7] xdiff: conditionally use Rust's implementation of xxhash

In reply to Phillip Wood

Hi, I have a different but related question. Xdiff is currently licensed under LGPL, not GPL. With the new Rust code not having any license header in their files, what is the intention for the licensing for them? Given that these are derived from the original Xdiff code, I would have imagined they would use the existing LGPL license for Xdiff, but the lack of licensing header makes it seem like they are just going to inherit the GPL license from Git. Is this a conscious relicensing effort? Or just something that hasn't come up yet? Otherwise if xdiff stops being a standalone codebase (due to it relying on the Rust components), it would essentially mean it ceases to be a library that could be used by other parties.

This is critical for downstream projects that use Xdiff. For example, libgit2 mtaintains an xdiff fork, and Vim (which I contribute to) / Neovim currently use Xdiff as the internal diff engine, which per my understanding is only possible due to the license being LGPL (Vim is licensed under the Vim license and Neovim is under Vim / Apache).

Quoted 59 lines · Phillip Wood

Hi Johannes

Quoted 20 lines · Johannes Schindelin

Hi Ezekiel,

rust/xdiff/src/lib.rs line 7

Quoted 12 lines · Ezekiel Newren via GitGitGadget
rust/xdiff/src/lib.rs +7 -0
index e69de29bb2d1..96975975a1ba 100644
@@ -0,0 +1,7 @@
+
+
+#[no_mangle]
+unsafe extern "C" fn xxh3_64(ptr: *const u8, size: usize) -> u64 {
+    let slice = std::slice::from_raw_parts(ptr, size);
+    xxhash_rust::xxh3::xxh3_64(slice)
+}

I know that this is a pretty small file, but I do notice that it does not have a license header.

Quoted 3 lines

This reminds me of the unfortunate oversight to be careful about making (and keeping) libgit.a's source files compatible with libgit2's license to nurture a fruitful exchange between those two projects.

I'm not sure I follow your reasoning here. libgit2 was started after git and chose to use an incompatible license. I wasn't around at the time but isn't there a list of git contributors who are happy to re-license their contributions with the linking exception used by libgit2?

Quoted 9 lines

With Rust, we still have a really good chance to learn from history and avoid that mistake: Gitoxide is a very exciting project with clear overlap in its mission to implement Git functionality in Rust. Gitoxide is dual-licensed under the Apache License v2 and the MIT license (see
https://github.com/GitoxideLabs/gitoxide?tab=readme-ov-file#license).

Would you mind adding a license header to that file that explicitly allows the contents of the file to be used in Gitoxide, to get the Rust effort started on a good foot?

I wary of that for two reasons. Firstly over time it is de-facto re-licensing git as the amount of rust code grows and the amount of C code shrinks which deserves a wider discussion. Secondly it makes it harder to convert our C code which is licensed under GPL2 (or in the case of xdiff LGPL) to rust if the rust code uses a different license.

If someone wants to start a discussion about re-licensing git (and is prepared to do all of the associated admin in the event that it happens) then by all means do so but I don't think it we want to slip such a change into this series.

Thanks

Phillip

#50 lore raw

Re: gitoxide-compatible licensing of Git's Rust code, was Re: [PATCH 6/7] xdiff: conditionally use Rust's implementation of xxhash

In reply to Phillip Wood
Quoted 9 lines · Phillip Wood
Quoted 8 lines · Jeff King

That probably needs to be explicitly granted
permission to relicense, whether to a specific project or not, and it is hard to pinpoint a definitive author for a lot of it (even if many authors have agreed to relicensing) because it has been touched by so many people over the years.

So there are probably two separate legal issues to consider:

Quoted 8 lines
Quoted 4 lines

- how the explicit re-licensing grant is worded

- what problems may came up with porting existing code that has been touched by many people

If we want to seriously consider this we should probably reach out to Conservancy for some advice. Did this end up being discussed at the Contributor's Summit?

Not really, no, as we didn't have enough time anymore towards the end.

But I agree, seeking advice from the SFC might be helpful in this context. At least until now I haven't heard from anybody who would be against the idea itself, excluding the potential re-licensing woes.

Would this be something that the PLC can do? I don't think it makes sense for random Git folks from the mailing list to approach them.

Cc'ing the PLC.

Patrick

#51 lore raw

Re: gitoxide-compatible licensing of Git's Rust code, was Re: [PATCH 6/7] xdiff: conditionally use Rust's implementation of xxhash

In reply to Phillip Wood

Hi Phillip,

Quoted 20 lines · Phillip Wood
Quoted 19 lines · Jeff King
Quoted 16 lines · Phillip Wood
Quoted 4 lines

If I understand the suggestion correctly, it's not to license it specifically to GitOxide. It's to use a permissive license (like GPL with linking exception) that would make it compatible with other projects with similar licenses (like GitOxide).

I was responding to this paragraph in Johannes' message

Note the exception? For new Rust code (and of course excluding code that has been ported verbatim from GPLv2-licensed code), GPL v2 could be used with an exception along these lines: This file is licensed under the GPL v2, with the exception that it can be freely used in the Gitoxide project.

That suggestion is pretty close to what libgit2 has in its git.git-authors file[1]. I'm not sure how practical it is to special case just one project though.

Quoted 7 lines
Quoted 4 lines

Ah, yeah, I may have misunderstood the proposal then.

I don't think that really changes much with respect to my concern, which is for existing code.

I agree it doesn't change anything with regard to that, I think it just adds more potential problems.

While we were discussing this, the decision kind of has been made already:
https://lore.kernel.org/git/[email protected]/

This saves us the effort to discuss the benefits and risks of opening up to collaborating with e.g. Gitoxide (or with Jujutsu, which most likely also would have preferred a more open license), at the expense of closing that door gently, quietly and firmly.

Ciao,
Johannes