From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (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 D742B19922F for ; Mon, 23 Sep 2024 12:18:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727093890; cv=none; b=chfOSaPrNL39xK+sKJScroPT+6pmeyBJzoxvnNPNBAbBCaObqCYEgXEDeKHUiuZ6KVkvFX70tmKCLlM48MckgW8J2IIwCE+lAe6QDLGO9SHAI+wEUXMTzGdenAnQffskStz9F/EZ2qLMVhL6AqCHkc1MT/++YdfO93I5vNyvBt0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727093890; c=relaxed/simple; bh=8fIRpxUpRyclDoF4Bz/TgegI9enFA66PPwz88UC4zHM=; h=Message-Id:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=osSOZm8tIRnWjl1XmROMPTMciX9uuWCrps+aawD0vgsnYHhPWV3Wl2TxLeD3fBZJS0+R+mucaUlf2iM7ibROeaFAB5hEtWjLTbi1KPY2NkgTB1srONcU664vI7kZEwvq6oxRJBVDib3lLvSNZGXvOF4CUP1oYkRtyB9aoiSWk34= 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=JGlBhjzt; arc=none smtp.client-ip=209.85.218.45 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="JGlBhjzt" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a8d3cde1103so296860566b.2 for ; Mon, 23 Sep 2024 05:18:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727093887; x=1727698687; 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=3ym6ewMAA+oVt0gY+7fjWAPeCV+RJ1gZYyUEKaYh2VY=; b=JGlBhjzt1I97FDEIoaf/hLus3K3eCMHiV5GxS4mn/bjDt4Ji/Yeq2i8EwtrMeuaC7l y6tEEe0X2vcEo/om0OiyfXrLf9Zl6boHrCty8WzEBuvSFv+X9bBEsP+G5x/jxCOllQZj wkb9/hPX4U1oSh1t+OEso/SGmKoN9Q45r9Wn1dFKjlGBR/g8W/HiJtSSt0/4PkmUhzTm tUNfI63SfiMtLs6yiRBPIxxX8xJpbfIcZ74d+iO/xHrvp4V7/E5OLLLvs22b0rUANi2B R1HjxQwUTWpVUJKhE3E70i2hTQLDJl7nQCU9gSCpXTHfvApgacLtbqFKXeOud5uS8sQb bCjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727093887; x=1727698687; 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=3ym6ewMAA+oVt0gY+7fjWAPeCV+RJ1gZYyUEKaYh2VY=; b=NrlYjpsyqq0xUwkFRLRXAaWoVcocqAc07W9AEfL21gaJ1N6yk/gimiVvNPWJOjY88p xjBOCBzDayuF424ezXTEcltDKEHQKeJTuwvuG8LzxjJlBoWgM2srE+prS74UP3Oau694 SUcF8ca9qeMfFKkaWzMHF74T2hZPsgK2+sJde1FYUrzBFlXSZXRUScoapSCN1YhUDvoh 6knT2NAdTkjYRKn7j8zN2FAJ6y3GznacktXHHmC2wm9eUgy1w8qWdogiS7tkRPei5hQV k3tNt6xw6RFm4kVFTYch+GWZ2MA+ik/y0qf1QiLUcRk+fKTxdqy9UyMiYjM4vKG3klD9 6puQ== X-Gm-Message-State: AOJu0YzZ44K+PH3V2Zin1xFGmtkDD17NBpmtDoTE4JBbpffIu8nlED8I Cysn6kUsLjNTwHxJt2nm3YLmDYKPP1jSWC5ydpHwuagFjh/l5f1xA+54gg== X-Google-Smtp-Source: AGHT+IELEyTXmbs9ihFYVOwoiR+pdUD4+IungcJqNWnHchmA7FLx9OltPwSrreXA+WJ+wIG01TpFew== X-Received: by 2002:a17:906:d247:b0:a86:ab84:7fc1 with SMTP id a640c23a62f3a-a90d580486cmr1132773566b.50.1727093886570; Mon, 23 Sep 2024 05:18:06 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3bbdsm1207664466b.116.2024.09.23.05.18.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 05:18:06 -0700 (PDT) Message-Id: In-Reply-To: References: From: "Xing Xin via GitGitGadget" Date: Mon, 23 Sep 2024 12:17:56 +0000 Subject: [PATCH v2 3/5] transport.c::handshake: make use of server options from remote Fcc: Sent Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 , blanet , 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 e22b217fba9..424cdeafcdd 100644 --- a/Documentation/fetch-options.txt +++ b/Documentation/fetch-options.txt @@ -304,6 +304,9 @@ endif::git-pull[] unknown ones, is server-specific. When multiple `--server-option=