Issues with PatchCheck script


Rebecca Cran
 

On 11/10/20 6:01 AM, Laszlo Ersek wrote:
On 11/10/20 05:42, Sandeep Dhanvada wrote:
Hi Laszlo,

I am able to execute PatchCheck.py on a patch generated from git format-patch, but, could not execute this script with git commits i.e., using -1 or -2 as arguments to read git commits.
IIRC an explicit commit range should work. For example,

$ python3 BaseTools/Scripts/PatchCheck.py master..
Similarly, "python3 BaseTools/Scripts/PatchCheck.py HEAD~2" also works.


--
Rebecca Cran


Laszlo Ersek
 

On 11/10/20 05:42, Sandeep Dhanvada wrote:
Hi Laszlo,

I am able to execute PatchCheck.py on a patch generated from git format-patch, but, could not execute this script with git commits i.e., using -1 or -2 as arguments to read git commits.
IIRC an explicit commit range should work. For example,

$ python3 BaseTools/Scripts/PatchCheck.py master..


PatchCheck didn't show any Warnings or Errors on the patch file. so, i executed git send-email with my patches to devel@edk2.groups.io, but, could not see my patch set in edk2 devel mailing list, https://edk2.groups.io/g/devel/topics. do i need to do anything else to send the patch to devel mailing list ?
You need to be both subscribed (up to you) and unmoderated (up to a
moderator) for your postings to go through immediately. A few of us take
turns at moderating the list, there may be delays for first time posters
(even after subscription). Sorry about that.

Your series should now be visible to all list subscribers:
<https://edk2.groups.io/g/devel/message/67177>. (It wasn't me that let
it through, another moderator got to it first.)

Thanks
Laszlo


Sandeep Dhanvada
 

Hi Laszlo,

I am able to execute PatchCheck.py on a patch generated from git format-patch, but, could not execute this script with git commits i.e., using -1 or -2 as arguments to read git commits.

PatchCheck didn't show any Warnings or Errors on the patch file. so, i executed git send-email with my patches to devel@edk2.groups.io, but, could not see my patch set in edk2 devel mailing list, https://edk2.groups.io/g/devel/topics. do i need to do anything else to send the patch to devel mailing list ?

Thanks,
Sandeep


Laszlo Ersek
 

On 10/28/20 12:45, Sandeep Dhanvada wrote:
Hi,

I have 2 local commits in EDK-II repo. As per the steps mentioned in https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process,
I am executing PatchCheck.py, but, the execution of this script is giving below error. I see that the command used is "git show --pretty=%cn <%ce>, --no-patch, --no-use-mailmap, <CommitID>, but, as git complains that there is no --no-patch option for git show and also format for --pretty should be in quotes. I tried on git version 1.8.3.1 and 2.1.1. Is there any specific git version needed to execute this script ?

==========
python BaseTools/Scripts/PatchCheck.py -1
Checking git commit: HEAD
Traceback (most recent call last):
File "BaseTools/Scripts/PatchCheck.py", line 770, in <module>
sys.exit(PatchCheckApp().retval)
File "BaseTools/Scripts/PatchCheck.py", line 733, in __init__
self.process_one_arg('HEAD')
File "BaseTools/Scripts/PatchCheck.py", line 747, in process_one_arg
self.ok &= CheckOneArg(arg, self.count).ok
File "BaseTools/Scripts/PatchCheck.py", line 714, in __init__
checker = CheckGitCommits(param, max_count)
File "BaseTools/Scripts/PatchCheck.py", line 650, in __init__
self.ok &= EmailAddressCheck(email, 'Committer').ok
File "BaseTools/Scripts/PatchCheck.py", line 36, in __init__
self.error('Email address is missing!')
File "BaseTools/Scripts/PatchCheck.py", line 47, in error
print('The ' + self.description + ' email address is not valid:')
AttributeError: EmailAddressCheck instance has no attribute 'description'

==========
"--no-patch" appeared in 1.8.4, as a synonym for "-s".

Not sure why it doesn't work with 2.1.1 -- perhaps your old git instance
appears first on $PATH?

Laszlo


Sandeep Dhanvada
 

No. I am using Python 2.7.5.
But, in any case, the script is issuing "git show --nopatch" command and git is complaining about --no-patch


Tomas Pilar (tpilar)
 

Are you using Python 3?

On Wed, Oct 28, 2020 at 11:45 AM Sandeep Dhanvada <
sandeep.dhanvada@...> wrote:

Hi,

I have 2 local commits in EDK-II repo. As per the steps mentioned in
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process
,
I am executing PatchCheck.py, but, the execution of this script is giving
below error. I see that the command used is "git show --pretty=%cn <%ce>,
--no-patch, --no-use-mailmap, <CommitID>, but, as git complains that there
is no --no-patch option for git show and also format for --pretty should be
in quotes. I tried on git version 1.8.3.1 and 2.1.1. Is there any specific
git version needed to execute this script ?

==========
python BaseTools/Scripts/PatchCheck.py -1
Checking git commit: HEAD
Traceback (most recent call last):
File "BaseTools/Scripts/PatchCheck.py", line 770, in <module>
sys.exit(PatchCheckApp().retval)
File "BaseTools/Scripts/PatchCheck.py", line 733, in __init__
self.process_one_arg('HEAD')
File "BaseTools/Scripts/PatchCheck.py", line 747, in process_one_arg
self.ok &= CheckOneArg(arg, self.count).ok
File "BaseTools/Scripts/PatchCheck.py", line 714, in __init__
checker = CheckGitCommits(param, max_count)
File "BaseTools/Scripts/PatchCheck.py", line 650, in __init__
self.ok &= EmailAddressCheck(email, 'Committer').ok
File "BaseTools/Scripts/PatchCheck.py", line 36, in __init__
self.error('Email address is missing!')
File "BaseTools/Scripts/PatchCheck.py", line 47, in error
print('The ' + self.description + ' email address is not valid:')
AttributeError: EmailAddressCheck instance has no attribute 'description'

==========


Thanks,
Sandeep






Sandeep Dhanvada
 

Hi,

I have 2 local commits in EDK-II repo. As per the steps mentioned in https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process,
I am executing PatchCheck.py, but, the execution of this script is giving below error. I see that the command used is "git show --pretty=%cn <%ce>, --no-patch, --no-use-mailmap, <CommitID>, but, as git complains that there is no --no-patch option for git show and also format for --pretty should be in quotes. I tried on git version 1.8.3.1 and 2.1.1. Is there any specific git version needed to execute this script ?

==========
python BaseTools/Scripts/PatchCheck.py -1
Checking git commit: HEAD
Traceback (most recent call last):
File "BaseTools/Scripts/PatchCheck.py", line 770, in <module>
sys.exit(PatchCheckApp().retval)
File "BaseTools/Scripts/PatchCheck.py", line 733, in __init__
self.process_one_arg('HEAD')
File "BaseTools/Scripts/PatchCheck.py", line 747, in process_one_arg
self.ok &= CheckOneArg(arg, self.count).ok
File "BaseTools/Scripts/PatchCheck.py", line 714, in __init__
checker = CheckGitCommits(param, max_count)
File "BaseTools/Scripts/PatchCheck.py", line 650, in __init__
self.ok &= EmailAddressCheck(email, 'Committer').ok
File "BaseTools/Scripts/PatchCheck.py", line 36, in __init__
self.error('Email address is missing!')
File "BaseTools/Scripts/PatchCheck.py", line 47, in error
print('The ' + self.description + ' email address is not valid:')
AttributeError: EmailAddressCheck instance has no attribute 'description'

==========


Thanks,
Sandeep