[PATCH v3 1/5] parser: Remove unused parameter

2016-12-01 Thread Stephen Finucane
The find_content function expected a 'project' parameter but never actually used it. Remove it and clean up tests accordingly. Signed-off-by: Stephen Finucane Cc: Paul Jakma Cc: Tom Rini --- patchwork/parser.py| 4 ++-- patchwork/tests/test_parser.py | 31 ++---

[PATCH v3 2/5] parser: Trivial rename of functions

2016-12-01 Thread Stephen Finucane
'auto_delegate' doesn't actually delegate the patches - it merely finds a suitable delegate based on the filename. Rename the function accordingly. 'find_delegate' is also renamed to prevent confusion. Signed-off-by: Stephen Finucane Cc: Paul Jakma Cc: Tom Rini --- patchwork/parser.py | 8 +++

[PATCH v3 3/5] hasher: Create hasher module

2016-12-01 Thread Stephen Finucane
This exposes the hashing functionality of Patchwork without requiring Django or similar dependencies. Signed-off-by: Stephen Finucane Cc: Paul Jakma Cc: Tom Rini --- patchwork/hasher.py | 87 + patchwork/models.py | 52 ++-

[PATCH v3 4/5] tools: Trivial formatting fixes

2016-12-01 Thread Stephen Finucane
These tools are currently broken, but before beginning surgery let's clean things up. Use standard 4 spaces and the longer, but easier to read, if-else-fi syntax for comparison. Missing license headers are added for completeness sake. Signed-off-by: Stephen Finucane Cc: Paul Jakma Cc: Tom Rini

[PATCH v3 5/5] tools: Update to use 'hasher'

2016-12-01 Thread Stephen Finucane
The old 'parser' module used to extract diffs from their surrounding mbox fluff before hashing this. Seeing as this was only used in the context of an actual git repo, avoid all of that rigmarole by just using 'git diff', which produces a plain diff, rather than 'git show'. Signed-off-by: Stephen

[PATCH v3 0/5] Resolve issues with 'tools' scripts

2016-12-01 Thread Stephen Finucane
There are two scripts provided in tools that reference the removed hash function of the 'parser' script. Move this hash function back into its own module and update these scripts to use said module. Changes since v2: - Only move the hash function into its own module - Don't use argparse as it's no

Re: [5/5] tools: Update to use 'parsemail --hash'

2016-12-01 Thread Stephen Finucane
On Tue, 2016-11-29 at 18:53 -0500, Tom Rini wrote: > On Fri, Nov 18, 2016 at 12:54:52AM +, Stephen Finucane wrote: > > > This replaces the older 'parser' main function. > > > > Signed-off-by: Stephen Finucane > > Cc: Paul Jakma > > With this series on top of 2941d6f47fd242d53c52e966501fb09

Re: [PATCH v3 1/5] parser: Remove unused parameter

2016-12-01 Thread Daniel Axtens
Looks good to me. Happily this should make the tests a little faster, which is always nice :) > diff --git a/patchwork/tests/test_parser.py b/patchwork/tests/test_parser.py > index 96166ad..e4a379d 100644 > --- a/patchwork/tests/test_parser.py > +++ b/patchwork/tests/test_parser.py > @@ -62,7 +62

Re: [PATCH v3 2/5] parser: Trivial rename of functions

2016-12-01 Thread Daniel Axtens
> -delegate = find_delegate(mail) > +delegate = find_delegate_by_header(mail) > if not delegate and diff: > filenames = find_filenames(diff) > -delegate = auto_delegate(project, filenames) > +delegate = find_delegate_by_filename(project,

Re: [PATCH v3 5/5] tools: Update to use 'hasher'

2016-12-01 Thread Daniel Axtens
Hi, > local hash > -hash=$(git show -C $1 | python $PWDIR/parser.py --hash) > +hash=$(git diff "$1~..$1" | python $pwpath/hasher.py) Does this function appropriately in the presence of merge commits? ISTR they had interesting behaviour and there was a difference between using ~ and u

Re: [PATCH v3 4/5] tools: Trivial formatting fixes

2016-12-01 Thread Daniel Axtens
Hi Stephen, While you're on a cleaning fix, may I suggest shellcheck.net? No pressure :) Regards, Daniel Stephen Finucane writes: > These tools are currently broken, but before beginning surgery let's > clean things up. Use standard 4 spaces and the longer, but easier to > read, if-else-fi syn

Re: [PATCH v3 3/5] hasher: Create hasher module

2016-12-01 Thread Daniel Axtens
Hi Stephen, AFAICT this is mostly a code move, not changing the functionality of the hasher. On that basis, and seeing how you're using it later on in the series: Reviewed-by: Daniel Axtens Regards, Daniel Stephen Finucane writes: > This exposes the hashing functionality of Patchwork without

Re: [PATCH v3 0/5] Resolve issues with 'tools' scripts

2016-12-01 Thread Daniel Axtens
Stephen Finucane writes: > There are two scripts provided in tools that reference the removed > hash function of the 'parser' script. Move this hash function back into > its own module and update these scripts to use said module. So, we need to start doing tests of this stuff - even if it's a se