diff options
author | Guido Günther <agx@sigxcpu.org> | 2022-05-26 20:59:08 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2022-05-27 10:32:40 +0200 |
commit | 42a140686674741827820e2ca7eede886c56d3cd (patch) | |
tree | 49eecd2ca84e9bfc2bc271e1a1e9184c0a19a3a8 | |
parent | 4d173ac01c4993726c92e36f39bfdfec385a6e7d (diff) |
clone: Allow to skip alias expansion
Add an option that allow to skip exansion of aliases like salsa:
by gbp so that git can do that.
Closes: #983085
-rw-r--r-- | docs/manpages/gbp-clone.xml | 10 | ||||
-rw-r--r-- | gbp/config.py | 4 | ||||
-rwxr-xr-x | gbp/scripts/clone.py | 4 |
3 files changed, 17 insertions, 1 deletions
diff --git a/docs/manpages/gbp-clone.xml b/docs/manpages/gbp-clone.xml index 849d990a..8f6044c5 100644 --- a/docs/manpages/gbp-clone.xml +++ b/docs/manpages/gbp-clone.xml @@ -33,6 +33,7 @@ <arg><option>--defuse-gitattributes=</option><replaceable>[auto|on|off]</replaceable></arg> <arg><option>--repo-user=</option><option>[GIT|DEBIAN]</option></arg> <arg><option>--repo-email=</option><option>[GIT|DEBIAN]</option></arg> + <arg><option>--[no-]aliases</option></arg> <arg choice="plain"><replaceable>repository</replaceable></arg> <arg><replaceable>directory</replaceable></arg> </cmdsynopsis> @@ -167,6 +168,15 @@ </listitem> </varlistentry> <varlistentry> + <term><option>--[no-]aliases</option> + </term> + <listitem> + <para> + Whether to expand gbp specific aliases for remote repos like <symbol>salsa:</symbol>. + </para> + </listitem> + </varlistentry> + <varlistentry> <term><replaceable>repository</replaceable></term> <listitem> <para> diff --git a/gbp/config.py b/gbp/config.py index ef5570d1..aa626343 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -102,6 +102,7 @@ class GbpOptionParser(OptionParser): @type def_config_files: dict (type, path) """ defaults = {'abbrev': 7, + 'aliases': 'True', 'allow-unauthenticated': 'False', 'arch': '', 'author-date-is-committer-date': 'False', @@ -194,6 +195,9 @@ class GbpOptionParser(OptionParser): 'urgency': 'medium', } help = { + 'aliases': + "Whether to expand gbp specific aliases like `salsa:`," + "default is '%(aliases)s'", 'debian-branch': "Branch the Debian package is being developed on, " "default is '%(debian-branch)s'", diff --git a/gbp/scripts/clone.py b/gbp/scripts/clone.py index d538cdfe..ae8bbc28 100755 --- a/gbp/scripts/clone.py +++ b/gbp/scripts/clone.py @@ -140,6 +140,7 @@ def build_parser(name): choices=['DEBIAN', 'GIT']) parser.add_config_file_option(option_name="defuse-gitattributes", dest="defuse_gitattributes", type="tristate", help="disable harmful Git attributes") + parser.add_boolean_config_file_option(option_name="aliases", dest="aliases") return parser @@ -164,7 +165,8 @@ def main(argv): gbp.log.err("Need a repository to clone.") return 1 else: - source = repo_to_url(args[1]) + remote_repo = args[1] + source = repo_to_url(remote_repo) if options.aliases else remote_repo if not source: return 1 |