public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-vcs/git/, dev-vcs/git/files/
Date: Fri, 12 Aug 2022 15:46:59 +0000 (UTC)	[thread overview]
Message-ID: <1660319047.33c5ec8d6f509841240464f248514320800f1229.sam@gentoo> (raw)

commit:     33c5ec8d6f509841240464f248514320800f1229
Author:     Thomas Bracht Laumann Jespersen <t <AT> laumann <DOT> xyz>
AuthorDate: Sat Aug  6 20:08:12 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 12 15:44:07 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33c5ec8d

dev-vcs/git: allow disabling "safe.directory"

Add IUSE="+safe-directory" that when not enabled, makes the
safe.directory configuration setting not take effect. The patch is meant
to be the smallest change (in terms of lines of code) that would let the
feature work for tests still.

Bug: https://github.com/pkgcore/pkgcheck/issues/412
Bug: https://bugs.gentoo.org/857831
Bug: https://bugs.gentoo.org/838127
Bug: https://bugs.gentoo.org/838223
Bug: https://bugs.gentoo.org/838271
Signed-off-by: Thomas Bracht Laumann Jespersen <t <AT> laumann.xyz>
Closes: https://github.com/gentoo/gentoo/pull/26762
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-vcs/git/files/git-2.37.2-unsafe-directory.patch | 14 ++++++++++++++
 dev-vcs/git/git-2.37.2.ebuild                       |  9 ++++++++-
 dev-vcs/git/metadata.xml                            |  1 +
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/dev-vcs/git/files/git-2.37.2-unsafe-directory.patch b/dev-vcs/git/files/git-2.37.2-unsafe-directory.patch
new file mode 100644
index 000000000000..27bf5413753a
--- /dev/null
+++ b/dev-vcs/git/files/git-2.37.2-unsafe-directory.patch
@@ -0,0 +1,14 @@
+Neuter the "safe directory" feature, except for tests.
+--- a/setup.c
++++ b/setup.c
+@@ -1157,7 +1157,9 @@ static int ensure_valid_ownership(const char *gitfile,
+ 	 */
+ 	read_very_early_config(safe_directory_cb, &data);
+ 
+-	return data.is_safe;
++	if (git_env_bool("GIT_TEST_ASSUME_DIFFERENT_OWNER", 0))
++		return data.is_safe;
++	return 1;
+ }
+ 
+ enum discovery_result {

diff --git a/dev-vcs/git/git-2.37.2.ebuild b/dev-vcs/git/git-2.37.2.ebuild
index 6b4a3f2ff057..70bd35f67fb0 100644
--- a/dev-vcs/git/git-2.37.2.ebuild
+++ b/dev-vcs/git/git-2.37.2.ebuild
@@ -51,7 +51,7 @@ fi
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="+blksha1 +curl cgi doc gnome-keyring +gpg highlight +iconv mediawiki mediawiki-experimental +nls +pcre perforce +perl +ppcsha1 selinux subversion tk +threads +webdav xinetd cvs test"
+IUSE="+blksha1 +curl cgi doc gnome-keyring +gpg highlight +iconv mediawiki mediawiki-experimental +nls +pcre perforce +perl +ppcsha1 +safe-directory selinux subversion tk +threads +webdav xinetd cvs test"
 
 # Common to both DEPEND and RDEPEND
 DEPEND="
@@ -253,6 +253,13 @@ src_prepare() {
 			"${FILESDIR}"/git-2.7.0-mediawiki-500pages.patch
 		)
 	fi
+	if ! use safe-directory ; then
+		# This patch neuters the "safe directory" detection.
+		# bugs #838271, #838223
+		PATCHES+=(
+			"${FILESDIR}"/git-2.37.2-unsafe-directory.patch
+		)
+	fi
 
 	default
 

diff --git a/dev-vcs/git/metadata.xml b/dev-vcs/git/metadata.xml
index a7248e6fdf0b..955f37f4086f 100644
--- a/dev-vcs/git/metadata.xml
+++ b/dev-vcs/git/metadata.xml
@@ -29,6 +29,7 @@
     <flag name="mediawiki-experimental">Add experimental patches for improved MediaWiki support</flag>
     <flag name="perforce">Add support for Perforce version control system (requires manual installation of Perforce client)</flag>
     <flag name="ppcsha1">Make use of a bundled routine that is optimized for the PPC arch</flag>
+    <flag name="safe-directory">Respect the safe.directory setting</flag>
     <flag name="subversion">Include git-svn for <pkg>dev-vcs/subversion</pkg> support</flag>
     <flag name="tk">Include the 'gitk' and 'git gui' tools</flag>
     <flag name="webdav">Adds support for push'ing to HTTP/HTTPS repositories via DAV</flag>


             reply	other threads:[~2022-08-12 15:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-12 15:46 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-11-30  7:48 [gentoo-commits] repo/gentoo:master commit in: dev-vcs/git/, dev-vcs/git/files/ Sam James
2022-09-01  3:11 Sam James
2021-11-08 18:42 Mike Gilbert
2021-08-17 10:58 Lars Wendler
2020-02-17  9:48 Lars Wendler
2019-10-26 12:55 Lars Wendler
2019-05-14  8:58 Lars Wendler
2018-09-04 15:53 Lars Wendler
2018-06-06 14:34 Lars Wendler
2017-05-24  8:49 Lars Wendler
2017-02-25 20:38 Lars Wendler
2016-06-07 12:26 Lars Wendler
2016-05-08 22:57 Mike Gilbert
2016-01-05 10:04 Lars Wendler
2015-11-19 23:26 Robin H. Johnson
2015-10-10 11:17 Justin Lecher
2015-09-29 15:16 Lars Wendler
2015-09-06 23:16 Joshua Kinard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1660319047.33c5ec8d6f509841240464f248514320800f1229.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox