On 03/08/16 21:03, Jordan Justen wrote:
> On 2016-03-08 11:44:46, Laszlo Ersek wrote:
>> On 03/08/16 20:31, Jordan Justen wrote:
>>> On 2016-03-08 03:25:06, Laszlo Ersek wrote:
>>>> On 03/08/16 04:15, Jordan Justen wrote:
>>>>> Fixes: https://github.com/tianocore/edk2/issues/63
>>>>> Contributed-under: TianoCore Contribution Agreement 1.0
>>>>> Signed-off-by: Jordan Justen <[email protected]>
>>>>> Cc: Yonghong Zhu <[email protected]>
>>>>> Cc: Liming Gao <[email protected]>
>>>>> Cc: Michael Kinney <[email protected]>
>>>>> ---
>>>>>  BaseTools/Scripts/ConvertMasmToNasm.py | 4 +++-
>>>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>>
>>>> Can you add some explanation to the commit message? At the moment it
>>>> doesn't tell me anything (and not much even after looking at issue #63).
>>>>
>>>> Just a suggestion. If you agree, it can be done when you commit the patch.
>>>>
>>>
>>> Good point. How is this for an updated commit message?
>>>
>>> ===
>>>
>>> BaseTools ConvertMasmToNasm: Fix running script outside of a git tree
>>>
>>> The script previously would hit an exception if it was run outside of
>>> a git tree. This caused issues for users of the script if they are not
>>
>> s/are/were/?
>>
> 
> In this case they still are not using git.

Sure, but you also wrote "caused". I thought the tenses of those two
should match. I'm not a native speaker though -- sorry.

> 
>>> using git.
>>>
>>> The exception looked like:
>>>
>>> edk2/BaseTools/Scripts/ConvertMasmToNasm.py Version 0.01
>>> Traceback (most recent call last):
>>>   File "edk2/BaseTools/Scripts/ConvertMasmToNasm.py", line 986, in <module>
>>>     ConvertAsmApp()
>>>   File "edk2/BaseTools/Scripts/ConvertMasmToNasm.py", line 984, in __init__
>>>     ConvertAsmFile(src, dst, self)
>>>   File "edk2/BaseTools/Scripts/ConvertMasmToNasm.py", line 209, in __init__
>>>     CommonUtils.__init__(self, clone)
>>>   File "edk2/BaseTools/Scripts/ConvertMasmToNasm.py", line 69, in __init__
>>>     self.gitemail = clone.gitemail
>>> AttributeError: ConvertAsmApp instance has no attribute 'gitemail'
>>>
>>> Fixes: https://github.com/tianocore/edk2/issues/63
>>> Contributed-under: TianoCore Contribution Agreement 1.0
>>> Signed-off-by: Jordan Justen <[email protected]>
>>> Cc: Yonghong Zhu <[email protected]>
>>> Cc: Liming Gao <[email protected]>
>>> Cc: Michael Kinney <[email protected]>
>>>
>>> ===
>>
>> Much better, but I still feel dumb. (It's your fault, you know. :))
>>
>> Can you please mention why the script uses git if it is invoked in a git
>> tree? (Sorry if it should be obvious from someplace else.)
>>
> 
> The script can be used with a --git parameter which will automatically
> generate commits. (Similar to the ones that you pushed for me.)
> 
> The script can also be used in other modes which aren't so closely
> tied to git. For example, to just convert a single file.
> 
> For example, someone may not be using git, and they want to use the
> script to convert their MASM source code to NASM.

Makes sense. I thought I had run the script with --help; turns out I
hadn't. The help output explains the git dependency. I agree the commit
message you proposed is detailed enough.

Acked-by: Laszlo Ersek <[email protected]>

Thanks
Laszlo

> -Jordan
> 
>>
>>
>>>
>>>>
>>>>> diff --git a/BaseTools/Scripts/ConvertMasmToNasm.py 
>>>>> b/BaseTools/Scripts/ConvertMasmToNasm.py
>>>>> index 7ad0bd2..2f0dd4f 100755
>>>>> --- a/BaseTools/Scripts/ConvertMasmToNasm.py
>>>>> +++ b/BaseTools/Scripts/ConvertMasmToNasm.py
>>>>> @@ -1,7 +1,7 @@
>>>>>  # @file ConvertMasmToNasm.py
>>>>>  # This script assists with conversion of MASM assembly syntax to NASM
>>>>>  #
>>>>> -#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
>>>>> +#  Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
>>>>>  #
>>>>>  #  This program and the accompanying materials
>>>>>  #  are licensed and made available under the terms and conditions of the 
>>>>> BSD License
>>>>> @@ -127,6 +127,7 @@ class CommonUtils:
>>>>>          while True:
>>>>>              path = os.path.split(lastpath)[0]
>>>>>              if path == lastpath:
>>>>> +                self.gitemail = None
>>>>>                  return
>>>>>              candidate = os.path.join(path, '.git')
>>>>>              if os.path.isdir(candidate):
>>>>> @@ -197,6 +198,7 @@ class CommonUtils:
>>>>>          message += '%s to %s\n' % (src, dst)
>>>>>          message += '\n'
>>>>>          message += 'Contributed-under: TianoCore Contribution Agreement 
>>>>> 1.0\n'
>>>>> +        assert(self.gitemail is not None)
>>>>>          message += 'Signed-off-by: %s\n' % self.gitemail
>>>>>  
>>>>>          cmd = ('git', 'commit', '-F', '-')
>>>>>
>>>>
>>

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to