From 03f3d75d43458978ecc375f7e16cfc8f35b5ae99 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Guido=20G=C3=BCnther?= Date: Mon, 10 Jan 2011 16:09:05 +0100 Subject: [PATCH] Make gbp-create-remote-repo a first class citizen Add manpage, move into path, add bash completion --- .gitignore | 1 + debian/control | 1 + debian/git-buildpackage.bash-completion | 11 ++ debian/rules | 8 +- docs/chapters/import.sgml | 2 +- docs/common.ent | 1 + docs/man.gbp-create-remote-repo.sgml | 11 ++ docs/manpages/gbp-create-remote-repo.sgml | 125 +++++++++++++++++++++ docs/manpages/manpages.ent | 1 + docs/manual.sgml | 1 + ...bp-create-remote-repo => gbp-create-remote-repo | 5 +- gbp.conf | 4 + gbp/config.py | 3 + setup.py | 2 +- 14 files changed, 167 insertions(+), 9 deletions(-) create mode 100644 docs/man.gbp-create-remote-repo.sgml create mode 100644 docs/manpages/gbp-create-remote-repo.sgml rename examples/gbp-create-remote-repo => gbp-create-remote-repo (97%) diff --git a/.gitignore b/.gitignore index 16c4a91..9b61fc8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ gbp/gbp_version.py gbp-clone.py gbp-pq.py gbp-pull.py +gbp-create-remote-repo.py git-buildpackage.py git-dch.py git-import-dsc.py diff --git a/debian/control b/debian/control index 8fcd5c5..b08a2ef 100644 --- a/debian/control +++ b/debian/control @@ -26,3 +26,4 @@ Description: Suite to help with Debian packages in Git repositories * git-dch: generate Debian changelog entries from Git commit messages * gbp-{pull,clone}: clone and pull from remote repos * gbp-pq: manage debian/patches easily + * gbp-create-remote-repo: create remote repositories diff --git a/debian/git-buildpackage.bash-completion b/debian/git-buildpackage.bash-completion index 1b85504..fda633e 100644 --- a/debian/git-buildpackage.bash-completion +++ b/debian/git-buildpackage.bash-completion @@ -155,3 +155,14 @@ _gbp_clone () _gbp_comp "$options" "$branch_opts" "$tag_opts" "$tristate_opts" } [ "${have:-}" ] && complete -F _gbp_clone -o default gbp-clone + +have gbp-create-remote-repo && +_gbp_create_remote_repo () +{ + local options=$(_gbp_options gbp-create-remote-repo) + local branch_opts="--debian-branch\= --upstream-branch\=" + local tristate_opts="--color\=" + + _gbp_comp "$options" "$branch_opts" "" "$tristate_opts" +} +[ "${have:-}" ] && complete -F _gbp_create_remote_repo -o default gbp-create-remote-repo diff --git a/debian/rules b/debian/rules index ab675e6..63c60c4 100755 --- a/debian/rules +++ b/debian/rules @@ -13,18 +13,18 @@ COMMANDS = git-buildpackage \ git-dch \ gbp-pull \ gbp-clone \ - gbp-pq + gbp-pq \ + gbp-create-remote-repo EXAMPLE_SCRIPTS=\ gbp-add-patch \ gbp-cowbuilder-sid \ gbp-pbuilder \ - gbp-posttag-push \ - gbp-create-remote-repo + gbp-posttag-push DEB_COMPRESS_EXCLUDE=$(EXAMPLE_SCRIPTS) -SGML_MANPAGES=$(patsubst %,docs/%.1,$(COMMANDS) gbp-pq) +SGML_MANPAGES=$(patsubst %,docs/%.1,$(COMMANDS)) POD_MANPAGES=docs/git-pbuilder.1 MANPAGES=$(SGML_MANPAGES) $(POD_MANPAGES) MANUAL=docs/manual-html diff --git a/docs/chapters/import.sgml b/docs/chapters/import.sgml index 079ea33..cbb8804 100644 --- a/docs/chapters/import.sgml +++ b/docs/chapters/import.sgml @@ -168,6 +168,6 @@ EOF &git-import-orig; 0.1 ../package-0.1.tar.gz dh_make - That's it, you're done. + That's it, you're done. If you want to publish you're new repository you can use &gbp-create-remote-repo;. diff --git a/docs/common.ent b/docs/common.ent index 19fbd44..8a7e3e2 100644 --- a/docs/common.ent +++ b/docs/common.ent @@ -11,6 +11,7 @@ gbp-pull"> gbp-clone"> gbp-pq"> + gbp-create-remote-repo"> git"> gitk"> pbuilder"> diff --git a/docs/man.gbp-create-remote-repo.sgml b/docs/man.gbp-create-remote-repo.sgml new file mode 100644 index 0000000..f46421a --- /dev/null +++ b/docs/man.gbp-create-remote-repo.sgml @@ -0,0 +1,11 @@ + + %COMMON; + + %MANPAGES; +]> + + +git-buildpackage Manual +&man.gbp.create.remote.repo; + diff --git a/docs/manpages/gbp-create-remote-repo.sgml b/docs/manpages/gbp-create-remote-repo.sgml new file mode 100644 index 0000000..a68b74d --- /dev/null +++ b/docs/manpages/gbp-create-remote-repo.sgml @@ -0,0 +1,125 @@ + + +
+ &dhemail; +
+ + &dhfirstname; + &dhsurname; + +
+ + gbp-create-remote-repo + &dhsection; + + + &gbp-create-remote-repo; + + Create remote repositories + + + + &gbp-create-remote-repo; + + [auto|on|off] + url-pattern + + branch_name + branch_name + + + + + DESCRIPTION + + &gbp-create-remote-repo; creates a repository at a remote location via ssh + and pushes the local repository into it. It then sets up remote branch + tracking so you can use &gbp-pull; to update your repo from there. + + + Note: By default the remote repositories are created in the collab-maint repository on alioth.debian.org. + + + + OPTIONS + + + =pattern + + + Where to create the remote repository. The part + %(pkg)s will be replaced by the package name. + + + + + =branch_name + + + The branch in the Git repository the Debian package is being + developed on, default is master. + + + + =branch_name + + + The branch in the &git; repository the upstream sources are put + onto. Default is upstream. + + + + + + + Whether to push the pristine tar branch. + + + + + + + verbose execution + + + + [auto|on|off] + + + Wheter to use colored output. + + + + + + + Wheter to set up branch tracking for the debian, upstream and + pristine-tar branches. + + + + + &man.git.config-files; + + + SEE ALSO + + + git-buildpackage + 1 + , + + gbp-pull + 1 + + + + + AUTHOR + + &dhusername; &dhemail; + + +
diff --git a/docs/manpages/manpages.ent b/docs/manpages/manpages.ent index 62115cf..be577db 100644 --- a/docs/manpages/manpages.ent +++ b/docs/manpages/manpages.ent @@ -6,5 +6,6 @@ + diff --git a/docs/manual.sgml b/docs/manual.sgml index 7977691..3e3add8 100644 --- a/docs/manual.sgml +++ b/docs/manual.sgml @@ -35,6 +35,7 @@ &man.gbp.clone; &man.gbp.pull; &man.gbp.pq; + &man.gbp.create.remote.repo; Copyright diff --git a/examples/gbp-create-remote-repo b/gbp-create-remote-repo similarity index 97% rename from examples/gbp-create-remote-repo rename to gbp-create-remote-repo index 6df67ae..e62ef06 100755 --- a/examples/gbp-create-remote-repo +++ b/gbp-create-remote-repo @@ -96,14 +96,13 @@ def main(argv): parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='', usage='%prog [options] - create a remote repository') - branch_group = GbpOptionGroup(parser, "branch options", "branch layout options") + branch_group = GbpOptionGroup(parser, "branch options", "branch layout and tracking options") branch_group.add_config_file_option(option_name="remote-url-pattern", dest="remote_url") parser.add_option_group(branch_group) branch_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch") branch_group.add_config_file_option(option_name="debian-branch", dest="debian_branch") branch_group.add_boolean_config_file_option(option_name="pristine-tar", dest="pristine_tar") - branch_group.add_option("--track", dest='track', action="store_true", default=False, - help="Set up tracking for remote branches") + branch_group.add_boolean_config_file_option(option_name="track", dest='track') parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="verbose command execution") parser.add_config_file_option(option_name="color", dest="color", type='tristate') diff --git a/gbp.conf b/gbp.conf index 941d441..f4b334f 100644 --- a/gbp.conf +++ b/gbp.conf @@ -100,3 +100,7 @@ # Options only affecting gbp- [gbp-pull] #pristine-tar = True + +[gbp-create-remote-repo] +# disable remote branch tracking +#track = False diff --git a/gbp/config.py b/gbp/config.py index 51dc7e6..7a4f743 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -96,6 +96,7 @@ class GbpOptionParser(OptionParser): 'patch-numbers' : 'True', 'notify' : 'auto', 'merge' : 'True', + 'track' : 'True', } help = { 'debian-branch': @@ -154,6 +155,8 @@ class GbpOptionParser(OptionParser): "Whether to send a desktop notification after the build, default is '%(notify)s'", 'merge': "after the import merge the result to the debian branch, default is '%(merge)s'", + 'track': + "set up tracking for remote branches, default is '%(track)s'", } config_files = [ '/etc/git-buildpackage/gbp.conf', os.path.expanduser('~/.gbp.conf'), diff --git a/setup.py b/setup.py index 2b9edcc..bd3ab45 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ setup(name = "git_build_package", author = 'Guido Guenther', author_email = 'agx@sigxcpu.org', scripts = [ 'git-buildpackage', 'git-import-dsc', 'git-import-orig', 'git-dch', 'git-import-dscs', - 'gbp-pq', 'gbp-pull', 'gbp-clone', 'git-pbuilder' ], + 'gbp-pq', 'gbp-pull', 'gbp-clone', 'git-pbuilder', 'gbp-create-remote-repo'], packages = [ 'gbp' ], data_files = [("/etc/git-buildpackage/", ["gbp.conf" ]),], ) -- 2.7.4