make --[no-]full a config file option
authorGuido Günther <agx@sigxcpu.org>
Tue, 24 Feb 2009 17:57:18 +0000 (18:57 +0100)
committerGuido Günther <agx@sigxcpu.org>
Thu, 26 Feb 2009 12:48:29 +0000 (13:48 +0100)
docs/manpages/git-dch.sgml
gbp.conf
gbp/config.py
git-dch

index eb639b8..890df67 100644 (file)
       <arg><option>--snapshot</option></arg>
       <arg><option>--release</option></arg>
       <arg><option>--auto</option></arg>
-      <arg><option>--full</option></arg>
-      <arg><option>--meta</option></arg>
+      <arg><option>--[no-]full</option></arg>
+      <arg><option>--[no-]meta</option></arg>
       <arg><option>--meta-closes=bug-close-tags</option></arg>
       <arg><option>--snapshot-number=</option><replaceable>expression</replaceable></arg>
       <arg><option>--git-log=</option><replaceable>git-log-options</replaceable></arg>
-      <arg><option>--git-author</option></arg>
+      <arg><option>--[no-]git-author</option></arg>
       <arg choice="plain"><replaceable>[path1 path2]</replaceable></arg>
     </cmdsynopsis>
   </refsynopsisdiv>
         </listitem>
       </varlistentry>
       <varlistentry>
-        <term><option>--meta</option></term>
+        <term><option>--[no-]meta</option></term>
         <listitem>
          <para>Parse meta tags like <option>Closes:</option> and
          <option>Thanks:</option>.  </para>
         </listitem>
       </varlistentry>
       <varlistentry>
-        <term><option>--full</option></term>
+        <term><option>--[no-]full</option></term>
         <listitem>
          <para>Include the full commit message in the changelog output</para>
         </listitem>
index 7075e99..6fa05a4 100644 (file)
--- a/gbp.conf
+++ b/gbp.conf
@@ -51,4 +51,5 @@
 #meta = False
 # what tags to look for to generate bug-closing changelog entries
 #meta-closes = Closes|LP
+#full = False
 
index 9ef668a..3d20bea 100644 (file)
@@ -45,6 +45,7 @@ class GbpOptionParser(OptionParser):
                  'ignore-new'      : 'False',
                  'meta'            : 'False',
                  'meta-closes'     : 'Closes|LP',
+                 'full'            : 'False',
                  'id-length'       : '0',
                  'no-dch'          : 'False',
                  'git-author'      : 'False',
@@ -68,6 +69,10 @@ class GbpOptionParser(OptionParser):
                   "files to filter out during import (can be given multiple times)",
              'git-author':
                   "use name and email from git-config for changelog trailer, default is '%(git-author)s'",
+             'full':
+                  "include the full commit message instead of only the first line, default is '%(full)s'",
+             'meta':
+                  "parse meta tags in commit messages, default is '%(meta)s'",
            }
     config_files = [ '/etc/git-buildpackage/gbp.conf',
                      os.path.expanduser('~/.gbp.conf'),
diff --git a/git-dch b/git-dch
index 4851ea5..4c1619f 100755 (executable)
--- a/git-dch
+++ b/git-dch
@@ -217,7 +217,7 @@ def parse_commit(repo, commitid, options):
             elif line.startswith('Thanks: '):
                 thanks = line.split(' ', 1)[1].strip()
             else: # normal commit message
-                if options.short and msg:
+                if msg and not options.full:
                     continue
                 elif line.strip(): # don't add all whitespace lines
                     msg += line
@@ -288,12 +288,10 @@ def main(argv):
     version_group.add_option("-N", "--new-version", dest="new_version",
                       help="use this as base for the new version number")
     version_group.add_boolean_config_file_option(option_name="git-author", dest="git_author")
-    commit_group.add_config_file_option(option_name="meta", dest="meta",
-                      help="parse meta tags in commit messages, default is '%(meta)s'", action="store_true")
+    commit_group.add_boolean_config_file_option(option_name="meta", dest="meta")
     commit_group.add_config_file_option(option_name="meta-closes", dest="meta_closes",
                       help="Meta tags for the bts close commands, default is '%(meta-closes)s'")
-    commit_group.add_option("--full", action="store_false", dest="short", default=True,
-                      help="include the full commit message instead of only the first line")
+    commit_group.add_boolean_config_file_option(option_name="full", dest="full")
     commit_group.add_config_file_option(option_name="id-length", dest="idlen",
                       help="include N digits of the commit id in the changelog entry, default is '%(id-length)s'",
                       type="int", metavar="N")