git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] connect: use "service" enum for "name" argument

From
Jeff King <peff@peff.net>
Date
May 22, 2026, 04:43 UTC
Message-ID
<20260522044352.GA861761@coredump.intra.peff.net>
In-Reply-To
<ag7AJMbav6KgSCjj@pks.im>
On Thu, May 21, 2026 at 10:19:48AM +0200, Patrick Steinhardt wrote:
Show 12 quoted lines
> > +	switch (service) {
> > +	case GIT_CONNECT_UPLOAD_PACK:
> > +		return "git-upload-pack";
> > +	case GIT_CONNECT_RECEIVE_PACK:
> > +		return "git-receive-pack";
> > +	case GIT_CONNECT_UPLOAD_ARCHIVE:
> > +		return "git-upload-archive";
> > +	}
> > +	BUG("unknown git_connect_type: %d", service);
> > +}
> 
> Shouldn't this say "unknown git_connect_service" instead of "_type"?

Oops, yes. As you probably guessed, I started with "type" before realizing that "service" was a better word.

The patch is in next, so the fixup on top (of jk/connect-service-enum) is below.

-- >8 --
Subject: [PATCH] transport-helper: fix typo in BUG() message

We mistakenly refer to the git_connect_service enum as "_type" rather than "_service". Users should never see this message in practice, but it is slightly confusing when reading the code.

Reported-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Jeff King <peff@peff.net>
---
 transport-helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/transport-helper.c b/transport-helper.c
index bf37c5280c..b672801ae4 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -630,7 +630,7 @@ static const char *connect_service_cmd(enum git_connect_service service)
 	case GIT_CONNECT_UPLOAD_ARCHIVE:
 		return "git-upload-archive";
 	}
-	BUG("unknown git_connect_type: %d", service);
+	BUG("unknown git_connect_service: %d", service);
 }
 
 static int process_connect_service(struct transport *transport,
-- 
2.54.0.618.gdbb63b8024
Previous: Patrick Steinhardt
Message 3 of 3 in “connect: use "service" enum for "name" argument”
  1. connect: use "service" enum for "name" argumentJeff King, May 19, 2026
  2. Patrick SteinhardtMay 21, 2026
  3. Jeff KingMay 22, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.