Bug#858287: dep3changelog: parsing is too strict about blank lines
Nishanth Aravamudan
nish.aravamudan at canonical.com
Mon Mar 20 18:41:50 UTC 2017
Package: devscripts
Version: 2.16.8ubuntu1
Severity: normal
Tags: patch
Dear Maintainer,
dep3changelog currently fails to extract bug information from `git
format-patch` output, including the first example from
http://dep.debian.net/deps/dep3/.
This is because dep3changelog exits its main processing loop upon seeing
a line matching /^---/ (correctly) or /^\s*$/ (incorrectly).
The DEP3 spec has a specific structure mentioned, which refers to one or
two headers, where a headers start on a non-empty line and ends on an
empty line, but also says "Any parser that expect those fields in patch
headers should also accept non-structured content and simply append the
non-structured content to the value of the Description field." I believe
the example from the dep3 page (as well as most `git format-patch`
output) will include non-structured content in the form of the commit
message. Given that we only care about the first line of the commit
message (we really only want the shorthand), I think it is ok to just
skip any empty lines until we see the /^---/. We could extend the parser
to count headers and also stop after the second header, but this seems
like overkill for a fairly simple parser (that doesn't really care about
the header count, it just needs to not quit before seeing all the
structured fields).
Thanks,
Nish
-- System Information:
Debian Release: stretch/sid
APT prefers zesty
APT policy: (500, 'zesty')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.10.0-8-generic (SMP w/4 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
--
Nishanth Aravamudan
Ubuntu Server
Canonical Ltd
More information about the devscripts-devel
mailing list