public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/git] rawhide: update to 2.56.0
@ 2026-10-05 13:54 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-10-05 13:54 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/git
Branch : rawhide
Commit : 4fe49145479f0f74c07b17e87e7c3fb12952ab80
Author : Ondřej Pohořelský <opohorel@redhat.com>
Date   : 2026-10-05T15:53:02+02:00
Stats  : +147/-5 in 3 file(s)
URL    : https://src.fedoraproject.org/rpms/git/c/4fe49145479f0f74c07b17e87e7c3fb12952ab80?branch=rawhide

Log:
update to 2.56.0

---
diff --git a/git-2.56.0-http-strip-creds-effective-url.patch b/git-2.56.0-http-strip-creds-effective-url.patch
new file mode 100644
index 0000000..ab2f0db
--- /dev/null
+++ b/git-2.56.0-http-strip-creds-effective-url.patch
@@ -0,0 +1,134 @@
+From 76524c2604bceee48481909e7824494498c39a34 Mon Sep 17 00:00:00 2001
+From: Jeff King <peff@peff.net>
+Date: Mon, 28 Sep 2026 00:01:49 -0400
+Subject: [PATCH] http: handle curl stripping creds from effective url
+
+When we detect that curl performed a redirect of a URL we requested, we
+update our base URL to match the new location and flush the http_auth
+credentials. This goes back to c93c92f309 (http: update base URLs when
+we see redirects, 2013-09-28).
+
+We detect the redirect by comparing the requested URL to the response
+from CURLINFO_EFFECTIVE_URL, using a simple string comparison. This has
+worked fine for years, but a change in the upcoming curl 8.23.0 adds a
+complication. If our URL directly contains credentials (like
+"https://user:pass@example.com/foo.git"), then as of 7a6bd027d0
+(getinfo: make sure CURLINFO_EFFECTIVE_URL does not contain creds,
+2026-09-21), curl will strip the credentials from what it returns (so
+just "https://example.com/foo.git" in this case).
+
+This breaks our direct string comparison, and we believe that we've been
+redirected. We flush our http_auth credentials, and now subsequent
+requests will use the reduced URL, causing us to re-request credentials
+from the user. Notably this causes t5550.15 (among others) to complain;
+it tries a clone with credentials in the URL, and fails if the user is
+prompted at all.
+
+We can handle this new behavior by doing a more careful comparison: if
+the direct string comparison fails, we'll strip out the credentials
+ourselves and compare. This is a little extra work, but in practice it
+should only happen once per process.
+
+I've used curl's curl_url() interface to do the stripping here, mostly
+because its behavior should match the stripping it does internally. And
+also, though we have code to parse a URL, we don't have any to
+reconstruct it, making a single string comparison hard.
+
+One alternative would be to parse with url_parse() or similar, and
+compare the individual fields (skipping username/password). I think that
+would probably also work in practice, but it seemed to me that the
+simplest change would be sticking with string comparisons.
+
+The curl_url() interface appeared in 7.62.0. We document that 7.61.0 is
+still supported, so I've made it conditional here. Only new versions
+strip the result from CURLINFO_EFFECTIVE_URL, so it's OK for very old
+versions to skip the extra comparison. Likewise if we encounter any
+errors, we just quietly skip the comparison. That's fine if you don't
+have creds in your URLs, and if you do, you'll get end up in the
+existing error path (a redirect warning, and eventually an auth
+failure).
+
+Signed-off-by: Jeff King <peff@peff.net>
+Signed-off-by: Junio C Hamano <gitster@pobox.com>
+---
+ git-curl-compat.h |  7 +++++++
+ http.c            | 41 ++++++++++++++++++++++++++++++++++++++++-
+ 2 files changed, 47 insertions(+), 1 deletion(-)
+
+diff --git a/git-curl-compat.h b/git-curl-compat.h
+index 032aaf7126c977..25678b5dbd2c80 100644
+--- a/git-curl-compat.h
++++ b/git-curl-compat.h
+@@ -28,6 +28,13 @@
+  * introduced, oldest first, in the official version of cURL library.
+  */
+ 
++/**
++ * curl_url() interface added in 7.62.0 (October 2018)
++ */
++#if LIBCURL_VERSION_NUM >= 0x073e00
++#define GIT_CURL_HAVE_CURL_URL
++#endif
++
+ /**
+  * Versions before curl 7.66.0 (September 2019) required manually setting the
+  * transfer-encoding for a streaming POST; after that this is handled
+diff --git a/http.c b/http.c
+index c8fcfd7693e897..4af3c29c769559 100644
+--- a/http.c
++++ b/http.c
+@@ -2315,6 +2315,45 @@ static int http_request(const char *url,
+ 	return ret;
+ }
+ 
++#ifndef GIT_CURL_HAVE_CURL_URL
++#define strip_url_credential(in) NULL
++#else
++static char *strip_url_credential(const char *in)
++{
++	char *ret = NULL;
++	CURLU *url;
++
++	url = curl_url();
++	if (!url)
++		goto out;
++
++	if (curl_url_set(url, CURLUPART_URL, in, 0))
++		goto out;
++
++	curl_url_set(url, CURLUPART_USER, NULL, 0);
++	curl_url_set(url, CURLUPART_PASSWORD, NULL, 0);
++	curl_url_get(url, CURLUPART_URL, &ret, 0);
++
++out:
++	curl_url_cleanup(url);
++	return ret;
++}
++#endif
++
++static int match_effective_url(const char *asked, const char *got)
++{
++	char *stripped;
++	int ret;
++
++	if (!strcmp(asked, got))
++		return 1;
++
++	stripped = strip_url_credential(asked);
++	ret = stripped && !strcmp(stripped, got);
++	curl_free(stripped);
++	return ret;
++}
++
+ /*
+  * Update the "base" url to a more appropriate value, as deduced by
+  * redirects seen when requesting a URL starting with "url".
+@@ -2347,7 +2386,7 @@ static int update_url_from_redirect(struct strbuf *base,
+ 	const char *tail;
+ 	size_t new_len;
+ 
+-	if (!strcmp(asked, got->buf))
++	if (match_effective_url(asked, got->buf))
+ 		return 0;
+ 
+ 	if (!skip_prefix(asked, base->buf, &tail))

diff --git a/git.spec b/git.spec
index 204f523..40b0b51 100644
--- a/git.spec
+++ b/git.spec
@@ -86,8 +86,8 @@
 %global _package_note_file  %{_builddir}/%{name}-%{real_version}/.package_note-%{name}-%{version}-%{release}.%{_arch}.ld
 
 Name:           git
-Version:        2.55.0
-Release:        2%{?dist}
+Version:        2.56.0
+Release:        1%{?dist}
 Summary:        Fast Version Control System
 License:        BSD-3-Clause AND GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-or-later AND MIT
 URL:            https://git-scm.com/
@@ -138,7 +138,11 @@ Patch3:         0003-t-lib-git-svn-try-harder-to-find-a-port.patch
 
 # Configurates Apache test server to use `DavLockDBType sdbm`
 # Prevents t5540 failures on i686, s390x and ppc64le
-Patch5:         git-test-apache-davlockdbtype-config.patch
+Patch4:         git-test-apache-davlockdbtype-config.patch
+
+# http: handle curl stripping creds from effective url (curl >= 8.23.0)
+# https://lore.kernel.org/git/20260928040149.GA498186@coredump.intra.peff.net/
+Patch5:         git-2.56.0-http-strip-creds-effective-url.patch
 
 %if %{with docs}
 # pod2man is needed to build Git.3pm
@@ -257,6 +261,7 @@ BuildRequires:  perl(CGI::Carp)
 BuildRequires:  perl(CGI::Util)
 BuildRequires:  perl(DBD::SQLite)
 BuildRequires:  perl(Digest::MD5)
+BuildRequires:  perl(Digest::SHA)
 BuildRequires:  perl(Fcntl)
 BuildRequires:  perl(File::Basename)
 BuildRequires:  perl(File::Copy)
@@ -1048,6 +1053,9 @@ rmdir --ignore-fail-on-non-empty "$testdir"
 %{?with_docs:%{_pkgdocdir}/git-svn.html}
 
 %changelog
+* Mon Oct 05 2026 Ondřej Pohořelský <opohorel@redhat.com> - 2.56.0-1
+- update to 2.56.0
+
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 2.55.0-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

diff --git a/sources b/sources
index 4f0e816..03cb268 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (git-2.55.0.tar.xz) = 73a53e5e79e9c357884512ad9fe5788ce48c33fd7ebb49f7c68f63c872beb5c5766f4fd1a9d9a2d8c89c192dc801ac7339422e9eec644ada56215fe9803af741
-SHA512 (git-2.55.0.tar.sign) = d584cfaf219e957648f3e218e5fc9686c6cbd6a01398e0356621b461c275d76cb825a34ebe0241b2b9077e410c6861fde499db1505e784e35f671aec6535dd35
+SHA512 (git-2.56.0.tar.xz) = d240240aac3ad17fce48861be91dc0cd899c59d3d6014f7e0cc4b3174ef37c4fbfd5b6c4a520a6f5d7e452e5ad97752b40774ab680dc226acc630173475c6b87
+SHA512 (git-2.56.0.tar.sign) = 09d3178453319324be6c016c72f751fb0b6fd945d3ceb3fb2c7d53ab413fb43cd5b94a3e3759f0c07855bf78e247b7986cbc962a8a0ea14b7ed33ea55164836f

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-05 13:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-05 13:54 [rpms/git] rawhide: update to 2.56.0 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox