From: Stefan Sperling Subject: Re: gitproto: match on capabilities value as well To: Omar Polo Cc: gameoftrees@openbsd.org Date: Fri, 6 Feb 2026 16:40:23 +0100 On Fri, Feb 06, 2026 at 04:10:38PM +0100, Omar Polo wrote: > Hello, > > This is a required step in supporting sha256 in the networking protocol. > > I'm extracting this out because it's a bit tricky. > > I'll soon add the object-format=sha256 capability to fetch and send, but > the current matching logic only looks at the capability name and ignore > the value. So, if the server advertises object-format=sha1 we would > match it, even if we really wanted to "just" match on object-format=sha256. > > Hence, I think that we should also match on the capabilities value. ok? There are capabilities which do not use values that are known ahead of time, such as push-cert= or session-id=. match_capability() would no longer be able to match such capabilities. object-format seems like a special case. Could this be handled outside of match_capability()? Like we do for the "symref" capability, above the loop which calls match_capability()? This way we could keep match_capability() simple.