summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5ab0897)
This patch modifies the import command to check for standard 'git show'
output and parse it accordingly.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
lasthdr = 0
end = len(descr_lines)
lasthdr = 0
end = len(descr_lines)
# Parse the patch header
for pos in range(0, end):
# Parse the patch header
for pos in range(0, end):
if subject:
break
# get the subject
if subject:
break
# get the subject
- subject = descr_lines[pos]
+ subject = descr_lines[pos][descr_strip:]
+ if re.match('commit [\da-f]{40}$', subject):
+ # 'git show' output, look for the real subject
+ subject = ''
+ descr_strip = 4
lasthdr = pos + 1
# get the body
if lasthdr < end:
lasthdr = pos + 1
# get the body
if lasthdr < end:
- body = reduce(lambda x, y: x + '\n' + y, descr_lines[lasthdr:], '')
+ body = '\n' + '\n'.join(l[descr_strip:] for l in descr_lines[lasthdr:])
return (subject + body, authname, authemail, authdate)
return (subject + body, authname, authemail, authdate)