Skip to content

Commit

Permalink
fix matching series with no diffstat in cover letter
Browse files Browse the repository at this point in the history
Johannes doesn't include a diffstat and we used to depend
on the diffstat in the cover letter to tell if the patch
is local.

Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed Oct 3, 2020
1 parent 7001185 commit c6ce8a1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions netdev/tree_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ def _tree_name_should_be_local_files(raw_email):
foreign_found = False

lines = raw_email.split('\n')
regex = re.compile(r'^\s*([-\w/._]+)\s+\|\s+\d+\s*[-+]*\s*$')
r_diffstat = re.compile(r'^\s*([-\w/._]+)\s+\|\s+\d+\s*[-+]*\s*$')
r_header = re.compile(r'\+\+\+ b/([-\w/._]+)$')
for line in lines:
match = regex.match(line)
match = r_header.match(line)
if not match:
match = r_diffstat.match(line)
if not match:
continue

Expand Down Expand Up @@ -105,10 +108,6 @@ def _tree_name_should_be_local(raw_email):


def series_tree_name_should_be_local(series):
# TODO: always parse patches and match on the --- a/$path lines, to avoid the .../ problem
if series.cover_letter:
return _tree_name_should_be_local(series.cover_letter)

ret = True
for p in series.patches:
# Returns tri-state True, None, False. And works well:
Expand Down

0 comments on commit c6ce8a1

Please sign in to comment.