aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2010-06-19 15:55:28 +0200
committerGuido Günther <agx@sigxcpu.org>2010-06-19 16:05:46 +0200
commit5988e2087615a3eb218cbee7c6eb470b9df9be0c (patch)
tree59229dd3a4dfdd8cc8e8a426124ceafe26bdd151
parent7f0b81f1f8f132dbc6869613382a5455e8af3078 (diff)
Add 'ignore-branch' option
This disables the 'current branch' == 'debian-branch' check.
-rw-r--r--docs/manpages/git-buildpackage.sgml14
-rw-r--r--docs/manpages/git-dch.sgml9
-rw-r--r--gbp.conf2
-rw-r--r--gbp/config.py3
-rwxr-xr-xgit-buildpackage4
-rwxr-xr-xgit-dch5
6 files changed, 32 insertions, 5 deletions
diff --git a/docs/manpages/git-buildpackage.sgml b/docs/manpages/git-buildpackage.sgml
index 5d3d7231..a5cd159d 100644
--- a/docs/manpages/git-buildpackage.sgml
+++ b/docs/manpages/git-buildpackage.sgml
@@ -24,6 +24,7 @@
<arg><option>--git-verbose</option></arg>
<arg><option>--git-upstream-branch=</option><replaceable>treeish</replaceable></arg>
<arg><option>--git-debian-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--git-ignore-branch</option></arg>
<arg><option>--git-builder=</option><replaceable>BUILD_CMD</replaceable></arg>
<arg><option>--git-cleaner=</option><replaceable>CLEAN_CMD</replaceable></arg>
<arg><option>--git-[no-]sign-tags</option></arg>
@@ -93,8 +94,9 @@
<term><option>--git-[no-]ignore-new</option>
</term>
<listitem>
- <para>Build the .diff.gz and debian package although there are
- uncommitted changes in the source tree.</para>
+ <para>Don't abort if there are uncommitted changes in the source tree
+ or the current branch doesn't match the
+ <replaceable>debian-branch</replaceable>.
</listitem>
</varlistentry>
<varlistentry>
@@ -146,6 +148,14 @@
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>--git-ignore-branch</option>
+ </term>
+ <listitem>
+ <para>Don't check if the current branch matches
+ <replaceable>debian-branch</replaceable>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>--git-[no-]sign-tags</option>
</term>
<listitem>
diff --git a/docs/manpages/git-dch.sgml b/docs/manpages/git-dch.sgml
index 22491f40..e8683eb0 100644
--- a/docs/manpages/git-dch.sgml
+++ b/docs/manpages/git-dch.sgml
@@ -24,6 +24,7 @@
<arg><option>--verbose</option></arg>
<arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
<arg><option>--debian-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg><option>--ignore-branch</option></arg>
<arg><option>--since=</option><replaceable>commitish</replaceable></arg>
<arg><option>--snapshot</option></arg>
<arg><option>--release</option></arg>
@@ -74,6 +75,14 @@
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>--ignore-branch</option>
+ </term>
+ <listitem>
+ <para>Don't check if the current branch matches
+ <replaceable>debian-branch</replaceable>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>--verbose</option></term>
<term><option>-v</option></term>
<listitem>
diff --git a/gbp.conf b/gbp.conf
index 765f6ca3..9fe94e5d 100644
--- a/gbp.conf
+++ b/gbp.conf
@@ -14,6 +14,8 @@
#debian-tag = debian/%(version)s
# use pristine-tar:
#pristine-tar = True
+# Don't check if debian-branch == current branch
+#ignore-branch = True
# Options only affecting git-buildpackage
[git-buildpackage]
diff --git a/gbp/config.py b/gbp/config.py
index 8c4bf369..d2aa97b4 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -48,6 +48,7 @@ class GbpOptionParser(OptionParser):
'overlay' : 'False',
'tarball-dir' : '',
'ignore-new' : 'False',
+ 'ignore-branch' : 'False',
'meta' : 'False',
'meta-closes' : 'Closes|LP',
'full' : 'False',
@@ -86,6 +87,8 @@ class GbpOptionParser(OptionParser):
"parse meta tags in commit messages, default is '%(meta)s'",
'ignore-new':
"build with uncommited changes in the source tree, default is '%(ignore-new)s'",
+ 'ignore-branch':
+ "build although debian-branch != current branch, default is '%(ignore-new)s'",
'overlay':
"extract orig tarball when using export-dir option, default is '%(overlay)s'",
}
diff --git a/git-buildpackage b/git-buildpackage
index 7f2b2d40..7fd9d468 100755
--- a/git-buildpackage
+++ b/git-buildpackage
@@ -228,6 +228,7 @@ def main(argv):
help="Compression level, default is '%(compression-level)s'")
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 = "ignore-branch", dest="ignore_branch")
cmd_group.add_config_file_option(option_name="builder", dest="builder",
help="command to build the Debian package, default is '%(builder)s'")
cmd_group.add_config_file_option(option_name="cleaner", dest="cleaner",
@@ -274,9 +275,10 @@ def main(argv):
print >>sys.stderr, out
raise GbpError, "Use --git-ignore-new to ignore."
+ if not options.ignore_new and not options.ignore_branch:
if branch != options.debian_branch:
print >>sys.stderr, "You are not on branch '%s' but on '%s'" % (options.debian_branch, branch)
- raise GbpError, "Use --git-ignore-new to ignore or --git-debian-branch to set the branch name."
+ raise GbpError, "Use --git-ignore-branch to ignore or --git-debian-branch to set the branch name."
try:
cp = du.parse_changelog(changelog)
diff --git a/git-dch b/git-dch
index ec912df5..501d1b9d 100755
--- a/git-dch
+++ b/git-dch
@@ -295,6 +295,7 @@ def main(argv):
parser.add_option_group(commit_group)
parser.add_option_group(naming_group)
+ parser.add_boolean_config_file_option(option_name = "ignore-branch", dest="ignore_branch")
naming_group.add_config_file_option(option_name="debian-branch", dest="debian_branch")
naming_group.add_config_file_option(option_name="upstream-tag", dest="upstream_tag")
naming_group.add_config_file_option(option_name="debian-tag", dest="debian_tag")
@@ -341,9 +342,9 @@ def main(argv):
raise GbpError, "%s is not a git repository" % (os.path.abspath('.'))
branch = repo.get_branch()
- if options.debian_branch != branch:
+ if options.debian_branch != branch and not options.ignore_branch:
print >>sys.stderr, "You are not on branch '%s' but on '%s'" % (options.debian_branch, branch)
- raise GbpError, "Use --debian-branch to set the branch to pick changes from"
+ raise GbpError, "Use --ignore-branch to ignore or --debian-branch to set the branch name."
cp = parse_changelog(changelog)