public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] Add sync-git-clone-extra-opts and sync-git-pull-extra-opts
@ 2016-01-25  1:34 Brian Dolbec
  2016-01-25 10:24 ` Alexander Berntsen
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Dolbec @ 2016-01-25  1:34 UTC (permalink / raw
  To: gentoo-portage-dev

From f3ae0003f8cb0c5f4fc8728254ee05bda38d7304 Mon Sep 17 00:00:00 2001
From: Ross Konsolebox <konsolebox@gmail.com>
Date: Sun, 24 Jan 2016 16:27:36 +0800
Subject: [PATCH] Add sync-git-clone-extra-opts and sync-git-pull-extra-opts

---
 man/portage.5                            | 6 ++++++
 pym/portage/sync/modules/git/__init__.py | 5 ++++-
 pym/portage/sync/modules/git/git.py      | 4 ++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/man/portage.5 b/man/portage.5
index c9e70a0..7c2a8f7 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -968,6 +968,12 @@ Specifies CVS repository.
 Specifies clone depth to use for DVCS repositories. Defaults to 1 (only
 the newest commit). If set to 0, the depth is unlimited.
 .TP
+.B sync\-git\-clone\-extra\-opts
+Extra options to give to git when cloning repository (git clone).
+.TP
+.B sync\-git\-pull\-extra\-opts
+Extra options to give to git when updating repository (git pull).
+.TP
 .B sync\-hooks\-only\-on\-change
 If set to true, then sync of a given repository will not trigger postsync
 hooks unless hooks would have executed for a master repository or the
diff --git a/pym/portage/sync/modules/git/__init__.py b/pym/portage/sync/modules/git/__init__.py
index da46b7f..357eb82 100644
--- a/pym/portage/sync/modules/git/__init__.py
+++ b/pym/portage/sync/modules/git/__init__.py
@@ -50,7 +50,10 @@ def check_depth(self):
 					'exists and is a valid Git repository',
 			},
 			'validate_config': CheckGitConfig,
-			'module_specific_options': (),
+			'module_specific_options': (
+				'sync-git-clone-extra-opts',
+				'sync-git-pull-extra-opts',
+				),
 		}
 	}
 }
diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/modules/git/git.py
index 179c0de..e6724f6 100644
--- a/pym/portage/sync/modules/git/git.py
+++ b/pym/portage/sync/modules/git/git.py
@@ -54,6 +54,8 @@ def new(self, **kwargs):
 			git_cmd_opts += " --quiet"
 		if self.repo.sync_depth is not None:
 			git_cmd_opts += " --depth %d" % self.repo.sync_depth
+		if self.repo.module_specific_options.get('sync-git-clone-extra-opts'):
+			git_cmd_opts += " %s" % self.repo.module_specific_options['sync-git-clone-extra-opts']
 		git_cmd = "%s clone%s %s ." % (self.bin_command, git_cmd_opts,
 			portage._shell_quote(sync_uri))
 		writemsg_level(git_cmd + "\n")
@@ -79,6 +81,8 @@ def update(self):
 		git_cmd_opts = ""
 		if self.settings.get("PORTAGE_QUIET") == "1":
 			git_cmd_opts += " --quiet"
+		if self.repo.module_specific_options.get('sync-git-pull-extra-opts'):
+			git_cmd_opts += " %s" % self.repo.module_specific_options['sync-git-pull-extra-opts']
 		git_cmd = "%s pull%s" % (self.bin_command, git_cmd_opts)
 		writemsg_level(git_cmd + "\n")
 

-- 
Brian Dolbec <dolsen>



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [gentoo-portage-dev] [PATCH] Add sync-git-clone-extra-opts and sync-git-pull-extra-opts
  2016-01-25  1:34 [gentoo-portage-dev] [PATCH] Add sync-git-clone-extra-opts and sync-git-pull-extra-opts Brian Dolbec
@ 2016-01-25 10:24 ` Alexander Berntsen
  2016-03-10 23:00   ` Brian Dolbec
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Berntsen @ 2016-01-25 10:24 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: konsolebox

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

While the patch looks OK, there's nothing in the commit message
motivating *why* it is desirable to add these things.

- -- 
Alexander
bernalex@gentoo.org
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCgAGBQJWpff1AAoJENQqWdRUGk8BX7YQALGRbNKCMzy+QZn3e2sU+Ls4
4lyW8oqu0lnL2UMRYJhyW3IxOms+o9hKgXE4/M70MktYU0Xt4//kKYj4Qxk+Uolb
9hrqxQvAM9s+iNlGBA6rfmX9XAvsSDhzGubxg2oysRfROnb1QgKacSdzoXPbahWO
4xmbT3/0RbIkdrnSDd78xrg4zmxEgGdNB92lKm3DsWnVr/Qv8Oo+ETMJAcjshRUp
UNiV/pDWOnmzsNtCUMrMRUNMJPXS1kkEdRtV1PaazNBeQViNmD3TVoC+PlI6on8j
vlcQiPezN5eyAEtABK1WJEPeUItAQsj+U8A3mOmOSBlQ8Wu6AQHqzvaQaWXUMKUM
KiA6Xk/dmhoSkmu8Z5V0fnae7sJLd1MkSJWVBrdPzvFgoZT0vdezaKtzbauHmERU
qkV1l+39I73PbALKWKTpXYFsh7LzSB5VQ5nm/Jf6WnmdSS2UXXsrTpYcq+bMxTMW
09E0NMr3nlRZ5WgKVsd9bLacHnF72KQGyS6VUkJWI+Vw+OF9Q3+G5oFrMxxOarVR
IMSZ438LD/jRLWMLnqrRvGA2P9kmiTUhKIxKATYUBTT/aBKtwY5uWKTO28VeM5i4
LUd1PvLQdJmc63hjm6eFx5VUHGW/b3WJ5mdudauQEVVE8Z/o0oDuRQxhiNWEbMzN
7tabyhw5JujI5mW9Umzj
=t/eb
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-portage-dev] [PATCH] Add sync-git-clone-extra-opts and sync-git-pull-extra-opts
  2016-01-25 10:24 ` Alexander Berntsen
@ 2016-03-10 23:00   ` Brian Dolbec
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Dolbec @ 2016-03-10 23:00 UTC (permalink / raw
  To: gentoo-portage-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On Mon, 25 Jan 2016 11:24:54 +0100
Alexander Berntsen <bernalex@gentoo.org> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
> 
> While the patch looks OK, there's nothing in the commit message
> motivating *why* it is desirable to add these things.
> 
> - -- 
> Alexander
> bernalex@gentoo.org

commit message fixed and merged...


- -- 
Brian Dolbec <dolsen>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.1

iQJ8BAEBCgBmBQJW4fxxXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNUQ3Qzc0RTA4MUNDNzBEQjRBNEFBRjVG
QkJEMDg3Mjc1ODIwRUQ4AAoJEPu9CHJ1gg7YoXUQAJsX5dsO+uepHeLZ7jzatHBm
CKp8qUdgXKFQtCTVtofFi2ZOiCAp4XKd0qNvmBg4YNqFz7fioKA6865V77wzjxvm
ecOdFk5/w4cwgmwc6k/9oDFDAwYf1sTydl5KpC5V7gs/5DaE8aoa4SoCloFDXyvU
x92DwMNDsJhxPjOpWB+KIJQ7u+v9J9EHyOs1Gds2XpqR6f1HFmjIBa4lQbxw5Rix
UKK5myppRVqIpXWkgOLB1Slu9KqQI23a1dX02MvPatKvgfx8X4MpFy4QcFadR5qJ
CsN9XwpIiZde9UNVkHp8SIb6iUxLStEGjNBFqW4MLvXpBb7ElV4vvbaM76swuBRS
ik9NIVgYrCqE9FdUylbdgeJKNHeAUUK1CrIPJFvAXsEpORS7cvIi21iX//2X0Vcx
a4RafHUp9/FVOokVSXKUsIEtGu3Lver+iIu8RaZNZNJ34TMDdAkMIcdLhKEV11KN
8I9jACO1srfQlOe+oyXX34c4zMsQSw/br8b19vUakWLF11BwVX7kG8HiPnq8OpUd
aqegW65CJGE+uVY8f/ZD0s6skQ5fob6MtecN4UVDCbjNn4XJ9EaungK+jgRd/NQ8
7mR4j+6yEfv9/UIwPWV+hSl39kt7nnQ/kbodoMpQtTVBOItQKBQ4zHOyd2Soyxq3
xilBC5qAtoReZH/hjOfW
=k458
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-10 23:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-25  1:34 [gentoo-portage-dev] [PATCH] Add sync-git-clone-extra-opts and sync-git-pull-extra-opts Brian Dolbec
2016-01-25 10:24 ` Alexander Berntsen
2016-03-10 23:00   ` Brian Dolbec

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