From: Brian Dolbec <dolsen@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Subject: [gentoo-portage-dev] [PATCH] Add sync-git-clone-extra-opts and sync-git-pull-extra-opts
Date: Sun, 24 Jan 2016 17:34:27 -0800 [thread overview]
Message-ID: <20160124173427.3b3c61b0.dolsen@gentoo.org> (raw)
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>
next reply other threads:[~2016-01-25 1:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-25 1:34 Brian Dolbec [this message]
2016-01-25 10:24 ` [gentoo-portage-dev] [PATCH] Add sync-git-clone-extra-opts and sync-git-pull-extra-opts Alexander Berntsen
2016-03-10 23:00 ` Brian Dolbec
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=20160124173427.3b3c61b0.dolsen@gentoo.org \
--to=dolsen@gentoo.org \
--cc=gentoo-portage-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