On Fri, Aug 04, 2023 at 04:58:33PM -0400, Chandan Somani wrote:
> Subject spellcheck on git-based patches is now included in commands like
> utilities/checkpatch.py -S -2. Additionally, a block of code that is
> used to call ovs_checkpatch_parse() has been deleted since
> ovs_checkpatch_file() calls ovs_checkpatch_parse() anyways. This
> prevents duplicate WARNINGS and ERRORS from being printed.
> 
> Signed-off-by: Chandan Somani <csom...@redhat.com>
> ---
>  utilities/checkpatch.py | 27 +++------------------------
>  1 file changed, 3 insertions(+), 24 deletions(-)
> 
> diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
> index 5c4aaefb3..fd44bacf1 100755
> --- a/utilities/checkpatch.py
> +++ b/utilities/checkpatch.py
> @@ -1111,30 +1111,9 @@ if __name__ == '__main__':
>          colors = True
>  
>      if n_patches:
> -        status = 0
> -
> -        git_log = 'git log --no-color --no-merges --pretty=format:"%H %s" '
> -        with os.popen(git_log + '-%d' % n_patches, 'r') as f:
> -            commits = f.read().split("\n")
> -
> -        for i in reversed(range(0, n_patches)):
> -            revision, name = commits[i].split(" ", 1)
> -            f = os.popen('''git format-patch -1 --stdout --pretty=format:"\
> -Author: %an <%ae>
> -Commit: %cn <%ce>
> -Subject: %s
> -
> -%b" ''' + revision, 'r')
> -            patch = f.read()
> -            f.close()
> -
> -            if not quiet:
> -                print('== Checking %s ("%s") ==' % (revision[0:12], name))
> -            result = ovs_checkpatch_parse(patch, revision)
> -            ovs_checkpatch_print_result()
> -            if result:
> -                status = EXIT_FAILURE
> -        sys.exit(status)
> +        patch_name = os.popen('git format-patch -' + str(n_patches))

Hi Chandan,

With this change, it appears that patch files, generated by git
format-patch, are left behind after checkpatch is run.
It also seems that this would overwrite any existing files with the same
name (though perhaps that was already the case).

This doesn't seem desirable from my perspective.

> +        args = patch_name.read().strip().split('\n')
> +        patch_name.close()
>  
>      if not args:
>          if sys.stdin.isatty():
> -- 
> 2.26.3
> 
> _______________________________________________
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> 
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to