# remove the '[*PATCH*]' expression in the subject
if descr:
- descr = re.findall('^(\[[^\s]*PATCH.*?\])?\s*(.*)$', descr)[0][1]
+ descr = re.findall('^(\[[^\s]*[Pp][Aa][Tt][Cc][Hh].*?\])?\s*(.*)$',
+ descr)[0][1]
descr += '\n\n'
else:
raise CmdException, 'Subject: line not found'
# the rest of the patch description
for line in f:
- if re.match('---\s*$', line) or re.match('diff -', line):
+ if re.match('---\s*$', line) or re.match('diff -', line) or \
+ re.match('^Index: ', line):
break
else:
descr += line