[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] xen/misra: diff-report.py: add report patching feature


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Thu, 25 May 2023 08:08:20 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Au+jPYUDDeqPC+Ot0IjQKqfRxPc9X6pYFIZFJsySTNM=; b=Dx8NrbdNvJZHxJQJA3WtTW2o3Zp9SEoAdyo4tTO6We+sqcqlZpVLW0Ct3KVucRyRXmeUg/JLtUoGpNcQk+QZv1cjkgz2lyUQKxLtnwjkI+Gd00KgtbbG83JwlVe4eMK9V0Ap0SJYnctlxFTmgzVYnYFAbZN9CMrU3MSuyeMpLOTvqCEgl1eSBcILMGProDAetvjVRS+GUFAg3gUFbWsKkkqqLdHfZsBFQloBh/U2XRL8FAdxcxFBNu8weuazkuGV0gXc12BUAkMojLGFD5vN+tiY9BEjVvUN0hiXVqvz2cHTYOMmO1bOyALn6elgjOb5a7qUPWWdEefPw0R+09L7Wg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=goYzyirzxaKEnkhdVsw3cEriToVX1wHCfZ9CLbUGR4LTELaTgp0PTNq+JhwKCViTLOG3UOCOKBRjIurROIyD6PADuoLWCZYC7orGbn+35Ar8yClzt3vNpBx8Zy+Yq/IiQMiFiJbLPmOR/QXfh9wSbprmICVkFBFIDOrnekrUZ/4fe5w8flVAQiZV9Fd/qLqFWUqh2N5D+2Cs25ktHrgGWQQM9ZCX0YH/ZQnTNAtX7lBjkezjEx1AMNmqkWDxLpYnbD1fMdaWaek4HF2UjbaJ9CCCfT/SMB5HMvBSVBI1M5eZ7RHYm9ZULB191bFIoOiee0jriLAN/juB7ixg8OO7wA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 25 May 2023 08:08:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZijbbQbnxRobwCkSJohEa6eKRVa9hY3kAgAjV3YCAAHJTAA==
  • Thread-topic: [PATCH 2/2] xen/misra: diff-report.py: add report patching feature

>>>    if args.out == "stdout":
>>>        file_out = sys.stdout
>>>    else:
>>> @@ -63,11 +90,35 @@ def main(argv):
>>>        new_rep.parse()
>>>        debug.debug_print_parsed_report(new_rep)
>>>        log_info(" [OK]")
>>> -    except ReportError as e:
>>> +        diff_source = None
>>> +        if args.patch:
>>> +            diff_source = os.path.realpath(args.patch)
>>> +        elif args.baseline_rev:
>>> +            git_diff = invoke_command(
>>> +                "git diff --git-dir={} -C -C {}..{}".format(repo_dir,
>>> +                                                            
>>> args.baseline_rev,
>>> +                                                            
>>> args.report_rev),
>>> +                True, "Error occured invoking:\n{}\n\n{}"
>>> +            )
>> 
>> I’ve noticed now an issue here, when using --baseline-rev/--report-rev, the 
>> fix is this one:
>> 
>> diff --git a/xen/scripts/diff-report.py b/xen/scripts/diff-report.py
>> index d608e3a05aa1..636f98f5eebe 100755
>> --- a/xen/scripts/diff-report.py
>> +++ b/xen/scripts/diff-report.py
>> @@ -95,9 +95,8 @@ def main(argv):
>>             diff_source = os.path.realpath(args.patch)
>>         elif args.baseline_rev:
>>             git_diff = invoke_command(
>> -                "git diff --git-dir={} -C -C {}..{}".format(repo_dir,
>> -                                                            
>> args.baseline_rev,
>> -                                                            
>> args.report_rev),
>> +                "git --git-dir={}/.git diff -C -C {}..{}"
>> +                .format(repo_dir, args.baseline_rev, args.report_rev),
>>                 True, "Error occured invoking:\n{}\n\n{}"
>>             )
>>             diff_source = git_diff.splitlines(keepends=True)
>> 
>> I’ll wait for other feedback on the patch before sending it again.
> 
> With this change:
> 
> Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> Tested-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>

Thank you Stefano,

I will push the serie with the fix and your tags


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.