From patchwork Tue Oct 8 03:38:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xing Xin X-Patchwork-Id: 13825607 Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F18842ABE for ; Tue, 8 Oct 2024 03:38:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728358708; cv=none; b=nuFhC/Rr6QG76TLC2EuwlgQEfAhlKnZ6mRi4TqlbjNdmjljN8lJIoD24QmhuSXDWyEwrSv/Bet9OhAWOwfIPxTjYozjw44Rp8gLMUeyeqCUpvyvJ1cE5/irAYb9Hz3tqdhVeGiGz/sFyHnp8MiXOM1mZjrallKOQLhSMkS1j9jQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728358708; c=relaxed/simple; bh=Rz/vK5uPmBZP+UYNuATM4PM7IXEU61ODpbFt0yViP6w=; h=Message-Id:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=I83dQlso6Lporq5CEUQuWQuWXRGHdO2sdfLaubHTcXJmfbxcbev9W4t/AEkrHqubEAxB/M+ZcQvtitGnAHIWqO5a0unlStzsJ6BFmTZYqGWmTfzSHSsSqye05ugRP/oz7a+jCn/pYZ+KXvgPjXfRP4aMO/UsEct4w1zyWFlGHsE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=I8aJJ6q8; arc=none smtp.client-ip=209.85.208.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="I8aJJ6q8" Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-5c88b5c375fso6322897a12.3 for ; Mon, 07 Oct 2024 20:38:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728358704; x=1728963504; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=MGV5V522FCK2dLh6Pcq7jJpa3WeLc5JhyQxpM0hZSYI=; b=I8aJJ6q8P9s8URqr8uqMslJ1BHl7ZsPjalbFzTIvm89xT0kbawCo1exG4cbf2yBnXI vIKk0RbWBCrG/hKp18QUmAnH4DRz9Y6uvrtBdTIMtCL/Lo/ePk9DdlHuQhlOHzHtO8Ik 2RstjzsTK48SqROKENTZjDBUkAccvqT3Bh4afZMnW4Jv51op4E75XRHtjX3k/CP7QVV5 b//fbxqKFL2yM/Gv2YNTnmjJIDMpxehOnUYxhK05lfas73OA1qAp/WbcQBGitrmm1D0x FP1q5edI9c2IK0XFiAJQe4QL+sM3ednk2HH+IZY60J0TRXhzK/AX+WJIrusmh/Tj2uwf v14w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728358704; x=1728963504; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MGV5V522FCK2dLh6Pcq7jJpa3WeLc5JhyQxpM0hZSYI=; b=fnrWVvIY4fWnOF/gBc3KppBLlMhF86LsoRA5j9E+4PXwBCNvCe5IKXwCosfEXvIlMV QIYjSsC5D5kpIb3O0a1dLZ7W//C7nFlmZXcDtJc2V4H55zAgjj+LQ+uiYeYextqOJoVc wRaVifZ0AR0OBK6Cuk7KU7j8L+yMjPjJw786Dz0UN8K2bljcm2TiJ1TkmA2HzC3D+EPB VAGdAroTsjUPXnGpQ1DJglyb5O7ysZIgA2bls3YpDfWrUfePp+DyG3rsk6nh4usHmiBW oQ1QfkEHrE3RYtsQZ1me3TwmS4ldNZNEsyeP2dQXHmtiSakjDOwL2Dnd14Z04JgtQsjh zIKg== X-Gm-Message-State: AOJu0Yx1CXPyifmrSSHrq/a5nxknY0X27AQSYZhDG26EXEwLM7797LHM +ZdRkI5s+mQeeNMbe6ujDQ7FkWBQl8A5K1Y+32zkKNYa6U6fc9y3yKFHMg== X-Google-Smtp-Source: AGHT+IEyg7BhPyb4qp4Ni6Hw102sLFTRkQbVW/l1gEEjFDBBAwW6sSfBkc+J+y+V07OzhAQruEGGZA== X-Received: by 2002:a17:907:6093:b0:a99:4136:895f with SMTP id a640c23a62f3a-a99413696a0mr987427866b.41.1728358703625; Mon, 07 Oct 2024 20:38:23 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a992e5d0a32sm460037466b.19.2024.10.07.20.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 20:38:23 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Tue, 08 Oct 2024 03:38:17 +0000 Subject: [PATCH v3 3/5] transport.c::handshake: make use of server options from remote Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Brandon Williams , Jonathan Tan , Patrick Steinhardt , Liu Zhongbo , blanet , Xing Xin From: Xing Xin From: Xing Xin Utilize the `server_options` from the corresponding remote during the handshake in `transport.c` when Git protocol v2 is detected. This helps initialize the `server_options` in `transport.h:transport` if no server options are set for the transport (typically via `--server-option` or `-o`). While another potential place to incorporate server options from the remote is in `transport.c:transport_get`, setting server options for a transport using a protocol other than v2 could lead to unexpected errors (see `transport.c:die_if_server_options`). Relevant tests and documentation have been updated accordingly. Signed-off-by: Xing Xin --- Documentation/fetch-options.txt | 3 + Documentation/git-clone.txt | 3 + Documentation/git-ls-remote.txt | 3 + t/t5702-protocol-v2.sh | 123 ++++++++++++++++++++++++++++++++ transport.c | 3 + 5 files changed, 135 insertions(+) diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt index 80838fe37ef..9dc7ac8dbdc 100644 --- a/Documentation/fetch-options.txt +++ b/Documentation/fetch-options.txt @@ -305,6 +305,9 @@ endif::git-pull[] unknown ones, is server-specific. When multiple `--server-option=