]> git.ipfire.org Git - thirdparty/patchwork.git/commit
parser: fix parsing of patches with headings
authorJiri Benc <jbenc@redhat.com>
Thu, 28 Jun 2018 19:42:11 +0000 (15:42 -0400)
committerStephen Finucane <stephen@that.guru>
Fri, 13 Jul 2018 17:33:19 +0000 (18:33 +0100)
commit67faf96ab96d93252c89967ef766bcbe8214c0fc
tree1c2442692b704892c2876dc21ea09d05172e3d75
parentd6491b59d97ba7fd6a498490f4cb3b6159dd53ee
parser: fix parsing of patches with headings

Some people tend to use lines full of '=' as a fancy way to format headings
in their commit messages in a rst-like style. However, the current parser
treats such lines as a beginning of a diff.

The only currently used tool that produces diffs with '=' lines is quilt in
the default configuration. However, even with quilt, the diff looks this
way:

    Index: dir/file
    ===================================================================
    --- dir.orig/file
    +++ dir/file
    @@ ...etc...

It's enough to match on the "Index:" line. The state of the state machine is
kept at 1 when it encounters the '=' line, thus it's safe to remove the
match on '=' completely.

[This prevents us from properly parsing metadata out of the changelog. -dcz ]

Signed-off-by: Jiri Benc <jbenc@redhat.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
patchwork/parser.py