git-dch: add formatter that wraps the changelog entry
authorGuido Günther <agx@sigxcpu.org>
Mon, 25 Jul 2011 21:02:29 +0000 (23:02 +0200)
committerGuido Günther <agx@sigxcpu.org>
Tue, 26 Jul 2011 09:43:41 +0000 (11:43 +0200)
Closes: #626439
debian/rules
examples/wrap_cl.py [new file with mode: 0644]

index b6145d483b63b83779affe52728bd10410b9a44d..4642563685abe362e5b1992b2b9266a1a348766c 100755 (executable)
@@ -20,7 +20,8 @@ EXAMPLE_SCRIPTS=\
     gbp-add-patch          \
     gbp-cowbuilder-sid     \
     gbp-posttag-push       \
-    gbp-configure-unpatched-source
+    gbp-configure-unpatched-source \
+    wrap_cl.py
 
 DEB_COMPRESS_EXCLUDE=$(EXAMPLE_SCRIPTS)
 
diff --git a/examples/wrap_cl.py b/examples/wrap_cl.py
new file mode 100644 (file)
index 0000000..5f1c0c8
--- /dev/null
@@ -0,0 +1,14 @@
+# Simple changelog entry formatter
+#
+# It simply uses the built in formatter and linewraps the text
+#
+# Use git-dch --customizations=/usr/share/doc/git-buildpackage/examples/wrap_cl.py
+# or set it via gbp.conf
+
+import textwrap
+import gbp.dch
+
+def format_changelog_entry(commit_info, options, last_commit=False):
+    entry = gbp.dch.format_changelog_entry(commit_info, options, last_commit)
+    if entry:
+        return textwrap.wrap(" ".join(entry))