public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.
@ 2020-07-21  2:58 Guomin Jiang
  2020-07-21  5:56 ` Liming Gao
  0 siblings, 1 reply; 8+ messages in thread
From: Guomin Jiang @ 2020-07-21  2:58 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Liming Gao

When i upgrade openssl to 1.1.1g, error occurred when run PatchCheck.py.
The reason is that the submodule will end with LF, but it will check
based on file rule, it make no sense and need ignore the check.

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
 BaseTools/Scripts/PatchCheck.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index 7db0775d14d1..46b9936c6576 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -405,12 +405,16 @@ class GitDiffCheck:
                     #
                     self.force_crlf = False
                 if self.filename == '.gitmodules' or \
+                   self.lines[self.line_num+1].endswith('160000\n') or \
                    self.filename == 'BaseTools/Conf/diff.order':
                     #
                     # .gitmodules and diff orderfiles are used internally by git
                     # use tabs and LF line endings.  Do not enforce no tabs and
                     # do not enforce CR/LF line endings.
                     #
+                    # When update submodule, it will encode with LF line and do
+                    # not enforce CR/LF line endings.
+                    #
                     self.force_crlf = False
                     self.force_notabs = False
             elif len(line.rstrip()) != 0:
-- 
2.25.1.windows.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.
  2020-07-21  2:58 [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule Guomin Jiang
@ 2020-07-21  5:56 ` Liming Gao
  2020-07-21 10:38   ` Guomin Jiang
  0 siblings, 1 reply; 8+ messages in thread
From: Liming Gao @ 2020-07-21  5:56 UTC (permalink / raw)
  To: Jiang, Guomin, devel@edk2.groups.io; +Cc: Feng, Bob C

Guomin:
  +                   self.lines[self.line_num+1].endswith('160000\n') or
  
  What means for this line? 


Thanks
Liming
-----Original Message-----
From: Jiang, Guomin <guomin.jiang@intel.com> 
Sent: 2020年7月21日 10:59
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.

When i upgrade openssl to 1.1.1g, error occurred when run PatchCheck.py.
The reason is that the submodule will end with LF, but it will check based on file rule, it make no sense and need ignore the check.

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
 BaseTools/Scripts/PatchCheck.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py index 7db0775d14d1..46b9936c6576 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -405,12 +405,16 @@ class GitDiffCheck:
                     #
                     self.force_crlf = False
                 if self.filename == '.gitmodules' or \
+                   self.lines[self.line_num+1].endswith('160000\n') or 
+ \
                    self.filename == 'BaseTools/Conf/diff.order':
                     #
                     # .gitmodules and diff orderfiles are used internally by git
                     # use tabs and LF line endings.  Do not enforce no tabs and
                     # do not enforce CR/LF line endings.
                     #
+                    # When update submodule, it will encode with LF line and do
+                    # not enforce CR/LF line endings.
+                    #
                     self.force_crlf = False
                     self.force_notabs = False
             elif len(line.rstrip()) != 0:
--
2.25.1.windows.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.
  2020-07-21  5:56 ` Liming Gao
@ 2020-07-21 10:38   ` Guomin Jiang
  2020-07-22  2:00     ` Liming Gao
  2020-07-22  2:08     ` Bob Feng
  0 siblings, 2 replies; 8+ messages in thread
From: Guomin Jiang @ 2020-07-21 10:38 UTC (permalink / raw)
  To: Gao, Liming, devel@edk2.groups.io; +Cc: Feng, Bob C

It is used to judge if the current change is for submodule.

The attribute of submodule is 160000, just like the file attribute of file is 10644.

Normally, the changed file will begin with 'diff --git' and the next line like ' index 954f66c056e..04300e71f38 100644' which end with the attribute, and changed submodule is similar.

> -----Original Message-----
> From: Gao, Liming <liming.gao@intel.com>
> Sent: Tuesday, July 21, 2020 1:57 PM
> To: Jiang, Guomin <guomin.jiang@intel.com>; devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>
> Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when
> upgrade submodule.
> 
> Guomin:
>   +                   self.lines[self.line_num+1].endswith('160000\n') or
> 
>   What means for this line?
> 
> 
> Thanks
> Liming
> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: 2020年7月21日 10:59
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming
> <liming.gao@intel.com>
> Subject: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade
> submodule.
> 
> When i upgrade openssl to 1.1.1g, error occurred when run PatchCheck.py.
> The reason is that the submodule will end with LF, but it will check based on
> file rule, it make no sense and need ignore the check.
> 
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> ---
>  BaseTools/Scripts/PatchCheck.py | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/BaseTools/Scripts/PatchCheck.py
> b/BaseTools/Scripts/PatchCheck.py index 7db0775d14d1..46b9936c6576
> 100755
> --- a/BaseTools/Scripts/PatchCheck.py
> +++ b/BaseTools/Scripts/PatchCheck.py
> @@ -405,12 +405,16 @@ class GitDiffCheck:
>                      #
>                      self.force_crlf = False
>                  if self.filename == '.gitmodules' or \
> +                   self.lines[self.line_num+1].endswith('160000\n') or
> + \
>                     self.filename == 'BaseTools/Conf/diff.order':
>                      #
>                      # .gitmodules and diff orderfiles are used internally by git
>                      # use tabs and LF line endings.  Do not enforce no tabs and
>                      # do not enforce CR/LF line endings.
>                      #
> +                    # When update submodule, it will encode with LF line and do
> +                    # not enforce CR/LF line endings.
> +                    #
>                      self.force_crlf = False
>                      self.force_notabs = False
>              elif len(line.rstrip()) != 0:
> --
> 2.25.1.windows.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.
  2020-07-21 10:38   ` Guomin Jiang
@ 2020-07-22  2:00     ` Liming Gao
  2020-07-22  2:08     ` Bob Feng
  1 sibling, 0 replies; 8+ messages in thread
From: Liming Gao @ 2020-07-22  2:00 UTC (permalink / raw)
  To: Jiang, Guomin, devel@edk2.groups.io; +Cc: Feng, Bob C

Guomin:
  OK. Please add this information in the patch for better reading. With this change, Reviewed-by: Liming Gao <liming.gao@intel.com>

Thanks
Liming
-----Original Message-----
From: Jiang, Guomin <guomin.jiang@intel.com> 
Sent: 2020年7月21日 18:38
To: Gao, Liming <liming.gao@intel.com>; devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>
Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.

It is used to judge if the current change is for submodule.

The attribute of submodule is 160000, just like the file attribute of file is 10644.

Normally, the changed file will begin with 'diff --git' and the next line like ' index 954f66c056e..04300e71f38 100644' which end with the attribute, and changed submodule is similar.

> -----Original Message-----
> From: Gao, Liming <liming.gao@intel.com>
> Sent: Tuesday, July 21, 2020 1:57 PM
> To: Jiang, Guomin <guomin.jiang@intel.com>; devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>
> Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when 
> upgrade submodule.
> 
> Guomin:
>   +                   self.lines[self.line_num+1].endswith('160000\n') or
> 
>   What means for this line?
> 
> 
> Thanks
> Liming
> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: 2020年7月21日 10:59
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming 
> <liming.gao@intel.com>
> Subject: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when 
> upgrade submodule.
> 
> When i upgrade openssl to 1.1.1g, error occurred when run PatchCheck.py.
> The reason is that the submodule will end with LF, but it will check 
> based on file rule, it make no sense and need ignore the check.
> 
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> ---
>  BaseTools/Scripts/PatchCheck.py | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/BaseTools/Scripts/PatchCheck.py 
> b/BaseTools/Scripts/PatchCheck.py index 7db0775d14d1..46b9936c6576
> 100755
> --- a/BaseTools/Scripts/PatchCheck.py
> +++ b/BaseTools/Scripts/PatchCheck.py
> @@ -405,12 +405,16 @@ class GitDiffCheck:
>                      #
>                      self.force_crlf = False
>                  if self.filename == '.gitmodules' or \
> +                   self.lines[self.line_num+1].endswith('160000\n') 
> + or \
>                     self.filename == 'BaseTools/Conf/diff.order':
>                      #
>                      # .gitmodules and diff orderfiles are used internally by git
>                      # use tabs and LF line endings.  Do not enforce no tabs and
>                      # do not enforce CR/LF line endings.
>                      #
> +                    # When update submodule, it will encode with LF line and do
> +                    # not enforce CR/LF line endings.
> +                    #
>                      self.force_crlf = False
>                      self.force_notabs = False
>              elif len(line.rstrip()) != 0:
> --
> 2.25.1.windows.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.
  2020-07-21 10:38   ` Guomin Jiang
  2020-07-22  2:00     ` Liming Gao
@ 2020-07-22  2:08     ` Bob Feng
  2020-07-22  2:21       ` Guomin Jiang
  1 sibling, 1 reply; 8+ messages in thread
From: Bob Feng @ 2020-07-22  2:08 UTC (permalink / raw)
  To: Jiang, Guomin, Gao, Liming, devel@edk2.groups.io

Guomin,

I have two comments.
1. Please only descript the patch's function in the commit message.
2. The file attribute is not always the next line of the line starts with "diff --git"

Thanks,
Bob

-----Original Message-----
From: Jiang, Guomin <guomin.jiang@intel.com> 
Sent: Tuesday, July 21, 2020 6:38 PM
To: Gao, Liming <liming.gao@intel.com>; devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>
Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.

It is used to judge if the current change is for submodule.

The attribute of submodule is 160000, just like the file attribute of file is 10644.

Normally, the changed file will begin with 'diff --git' and the next line like ' index 954f66c056e..04300e71f38 100644' which end with the attribute, and changed submodule is similar.

> -----Original Message-----
> From: Gao, Liming <liming.gao@intel.com>
> Sent: Tuesday, July 21, 2020 1:57 PM
> To: Jiang, Guomin <guomin.jiang@intel.com>; devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>
> Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when 
> upgrade submodule.
> 
> Guomin:
>   +                   self.lines[self.line_num+1].endswith('160000\n') or
> 
>   What means for this line?
> 
> 
> Thanks
> Liming
> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: 2020年7月21日 10:59
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming 
> <liming.gao@intel.com>
> Subject: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when 
> upgrade submodule.
> 
> When i upgrade openssl to 1.1.1g, error occurred when run PatchCheck.py.
> The reason is that the submodule will end with LF, but it will check 
> based on file rule, it make no sense and need ignore the check.
> 
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> ---
>  BaseTools/Scripts/PatchCheck.py | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/BaseTools/Scripts/PatchCheck.py 
> b/BaseTools/Scripts/PatchCheck.py index 7db0775d14d1..46b9936c6576
> 100755
> --- a/BaseTools/Scripts/PatchCheck.py
> +++ b/BaseTools/Scripts/PatchCheck.py
> @@ -405,12 +405,16 @@ class GitDiffCheck:
>                      #
>                      self.force_crlf = False
>                  if self.filename == '.gitmodules' or \
> +                   self.lines[self.line_num+1].endswith('160000\n') 
> + or \
>                     self.filename == 'BaseTools/Conf/diff.order':
>                      #
>                      # .gitmodules and diff orderfiles are used internally by git
>                      # use tabs and LF line endings.  Do not enforce no tabs and
>                      # do not enforce CR/LF line endings.
>                      #
> +                    # When update submodule, it will encode with LF line and do
> +                    # not enforce CR/LF line endings.
> +                    #
>                      self.force_crlf = False
>                      self.force_notabs = False
>              elif len(line.rstrip()) != 0:
> --
> 2.25.1.windows.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.
  2020-07-22  2:08     ` Bob Feng
@ 2020-07-22  2:21       ` Guomin Jiang
  2020-07-22  2:28         ` Bob Feng
  0 siblings, 1 reply; 8+ messages in thread
From: Guomin Jiang @ 2020-07-22  2:21 UTC (permalink / raw)
  To: Feng, Bob C, Gao, Liming, devel@edk2.groups.io

Hi Bob,

Can you provide a sample that the file attribute is not the next line.

Even if the case you mentioned is present, I seem that have not affect on the current behavior, isn't it?

Thanks.
Guomin
> -----Original Message-----
> From: Feng, Bob C <bob.c.feng@intel.com>
> Sent: Wednesday, July 22, 2020 10:08 AM
> To: Jiang, Guomin <guomin.jiang@intel.com>; Gao, Liming
> <liming.gao@intel.com>; devel@edk2.groups.io
> Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when
> upgrade submodule.
> 
> Guomin,
> 
> I have two comments.
> 1. Please only descript the patch's function in the commit message.
> 2. The file attribute is not always the next line of the line starts with "diff --
> git"
> 
> Thanks,
> Bob
> 
> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: Tuesday, July 21, 2020 6:38 PM
> To: Gao, Liming <liming.gao@intel.com>; devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>
> Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when
> upgrade submodule.
> 
> It is used to judge if the current change is for submodule.
> 
> The attribute of submodule is 160000, just like the file attribute of file is
> 10644.
> 
> Normally, the changed file will begin with 'diff --git' and the next line like '
> index 954f66c056e..04300e71f38 100644' which end with the attribute, and
> changed submodule is similar.
> 
> > -----Original Message-----
> > From: Gao, Liming <liming.gao@intel.com>
> > Sent: Tuesday, July 21, 2020 1:57 PM
> > To: Jiang, Guomin <guomin.jiang@intel.com>; devel@edk2.groups.io
> > Cc: Feng, Bob C <bob.c.feng@intel.com>
> > Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when
> > upgrade submodule.
> >
> > Guomin:
> >   +                   self.lines[self.line_num+1].endswith('160000\n') or
> >
> >   What means for this line?
> >
> >
> > Thanks
> > Liming
> > -----Original Message-----
> > From: Jiang, Guomin <guomin.jiang@intel.com>
> > Sent: 2020年7月21日 10:59
> > To: devel@edk2.groups.io
> > Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming
> > <liming.gao@intel.com>
> > Subject: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when
> > upgrade submodule.
> >
> > When i upgrade openssl to 1.1.1g, error occurred when run PatchCheck.py.
> > The reason is that the submodule will end with LF, but it will check
> > based on file rule, it make no sense and need ignore the check.
> >
> > Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> > Cc: Bob Feng <bob.c.feng@intel.com>
> > Cc: Liming Gao <liming.gao@intel.com>
> > ---
> >  BaseTools/Scripts/PatchCheck.py | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/BaseTools/Scripts/PatchCheck.py
> > b/BaseTools/Scripts/PatchCheck.py index 7db0775d14d1..46b9936c6576
> > 100755
> > --- a/BaseTools/Scripts/PatchCheck.py
> > +++ b/BaseTools/Scripts/PatchCheck.py
> > @@ -405,12 +405,16 @@ class GitDiffCheck:
> >                      #
> >                      self.force_crlf = False
> >                  if self.filename == '.gitmodules' or \
> > +                   self.lines[self.line_num+1].endswith('160000\n')
> > + or \
> >                     self.filename == 'BaseTools/Conf/diff.order':
> >                      #
> >                      # .gitmodules and diff orderfiles are used internally by git
> >                      # use tabs and LF line endings.  Do not enforce no tabs and
> >                      # do not enforce CR/LF line endings.
> >                      #
> > +                    # When update submodule, it will encode with LF line and do
> > +                    # not enforce CR/LF line endings.
> > +                    #
> >                      self.force_crlf = False
> >                      self.force_notabs = False
> >              elif len(line.rstrip()) != 0:
> > --
> > 2.25.1.windows.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.
  2020-07-22  2:21       ` Guomin Jiang
@ 2020-07-22  2:28         ` Bob Feng
  2020-07-22  7:29           ` Liming Gao
  0 siblings, 1 reply; 8+ messages in thread
From: Bob Feng @ 2020-07-22  2:28 UTC (permalink / raw)
  To: Jiang, Guomin, Gao, Liming, devel@edk2.groups.io

Here is a case.

diff --git a/BaseTools/BinWrappers/PosixLike/AmlToHex b/BaseTools/BinWrappers/PosixLike/AmlToC
similarity index 97%
rename from BaseTools/BinWrappers/PosixLike/AmlToHex
rename to BaseTools/BinWrappers/PosixLike/AmlToC
index 9fb68299e4c67d1f332cd883fd348a896f1bdc50..1dd28e966288f6ea4fc52d42e2dc7b1f74226c23 100755

self.line_num+1 looks a hard code based on an assumption. 

Thanks,
Bob

-----Original Message-----
From: Jiang, Guomin <guomin.jiang@intel.com> 
Sent: Wednesday, July 22, 2020 10:21 AM
To: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>; devel@edk2.groups.io
Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.

Hi Bob,

Can you provide a sample that the file attribute is not the next line.

Even if the case you mentioned is present, I seem that have not affect on the current behavior, isn't it?

Thanks.
Guomin
> -----Original Message-----
> From: Feng, Bob C <bob.c.feng@intel.com>
> Sent: Wednesday, July 22, 2020 10:08 AM
> To: Jiang, Guomin <guomin.jiang@intel.com>; Gao, Liming 
> <liming.gao@intel.com>; devel@edk2.groups.io
> Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when 
> upgrade submodule.
> 
> Guomin,
> 
> I have two comments.
> 1. Please only descript the patch's function in the commit message.
> 2. The file attribute is not always the next line of the line starts 
> with "diff -- git"
> 
> Thanks,
> Bob
> 
> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: Tuesday, July 21, 2020 6:38 PM
> To: Gao, Liming <liming.gao@intel.com>; devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>
> Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when 
> upgrade submodule.
> 
> It is used to judge if the current change is for submodule.
> 
> The attribute of submodule is 160000, just like the file attribute of 
> file is 10644.
> 
> Normally, the changed file will begin with 'diff --git' and the next line like '
> index 954f66c056e..04300e71f38 100644' which end with the attribute, 
> and changed submodule is similar.
> 
> > -----Original Message-----
> > From: Gao, Liming <liming.gao@intel.com>
> > Sent: Tuesday, July 21, 2020 1:57 PM
> > To: Jiang, Guomin <guomin.jiang@intel.com>; devel@edk2.groups.io
> > Cc: Feng, Bob C <bob.c.feng@intel.com>
> > Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check 
> > when upgrade submodule.
> >
> > Guomin:
> >   +                   self.lines[self.line_num+1].endswith('160000\n') or
> >
> >   What means for this line?
> >
> >
> > Thanks
> > Liming
> > -----Original Message-----
> > From: Jiang, Guomin <guomin.jiang@intel.com>
> > Sent: 2020年7月21日 10:59
> > To: devel@edk2.groups.io
> > Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming 
> > <liming.gao@intel.com>
> > Subject: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when 
> > upgrade submodule.
> >
> > When i upgrade openssl to 1.1.1g, error occurred when run PatchCheck.py.
> > The reason is that the submodule will end with LF, but it will check 
> > based on file rule, it make no sense and need ignore the check.
> >
> > Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> > Cc: Bob Feng <bob.c.feng@intel.com>
> > Cc: Liming Gao <liming.gao@intel.com>
> > ---
> >  BaseTools/Scripts/PatchCheck.py | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/BaseTools/Scripts/PatchCheck.py 
> > b/BaseTools/Scripts/PatchCheck.py index 7db0775d14d1..46b9936c6576
> > 100755
> > --- a/BaseTools/Scripts/PatchCheck.py
> > +++ b/BaseTools/Scripts/PatchCheck.py
> > @@ -405,12 +405,16 @@ class GitDiffCheck:
> >                      #
> >                      self.force_crlf = False
> >                  if self.filename == '.gitmodules' or \
> > +                   self.lines[self.line_num+1].endswith('160000\n')
> > + or \
> >                     self.filename == 'BaseTools/Conf/diff.order':
> >                      #
> >                      # .gitmodules and diff orderfiles are used internally by git
> >                      # use tabs and LF line endings.  Do not enforce no tabs and
> >                      # do not enforce CR/LF line endings.
> >                      #
> > +                    # When update submodule, it will encode with LF line and do
> > +                    # not enforce CR/LF line endings.
> > +                    #
> >                      self.force_crlf = False
> >                      self.force_notabs = False
> >              elif len(line.rstrip()) != 0:
> > --
> > 2.25.1.windows.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.
  2020-07-22  2:28         ` Bob Feng
@ 2020-07-22  7:29           ` Liming Gao
  0 siblings, 0 replies; 8+ messages in thread
From: Liming Gao @ 2020-07-22  7:29 UTC (permalink / raw)
  To: Feng, Bob C, Jiang, Guomin, devel@edk2.groups.io

For submodule, I see the diff content. So, can we use "Subproject commit" as key to ignore it?

-Subproject commit c3656cc594daac8167721dde7220f0e59ae146fc
+Subproject commit e2e09d9fba1187f8d6aafaa34d4172f56f1ffb72

Thanks
Liming
-----Original Message-----
From: Feng, Bob C <bob.c.feng@intel.com> 
Sent: 2020年7月22日 10:28
To: Jiang, Guomin <guomin.jiang@intel.com>; Gao, Liming <liming.gao@intel.com>; devel@edk2.groups.io
Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.

Here is a case.

diff --git a/BaseTools/BinWrappers/PosixLike/AmlToHex b/BaseTools/BinWrappers/PosixLike/AmlToC
similarity index 97%
rename from BaseTools/BinWrappers/PosixLike/AmlToHex
rename to BaseTools/BinWrappers/PosixLike/AmlToC
index 9fb68299e4c67d1f332cd883fd348a896f1bdc50..1dd28e966288f6ea4fc52d42e2dc7b1f74226c23 100755

self.line_num+1 looks a hard code based on an assumption. 

Thanks,
Bob

-----Original Message-----
From: Jiang, Guomin <guomin.jiang@intel.com>
Sent: Wednesday, July 22, 2020 10:21 AM
To: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>; devel@edk2.groups.io
Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.

Hi Bob,

Can you provide a sample that the file attribute is not the next line.

Even if the case you mentioned is present, I seem that have not affect on the current behavior, isn't it?

Thanks.
Guomin
> -----Original Message-----
> From: Feng, Bob C <bob.c.feng@intel.com>
> Sent: Wednesday, July 22, 2020 10:08 AM
> To: Jiang, Guomin <guomin.jiang@intel.com>; Gao, Liming 
> <liming.gao@intel.com>; devel@edk2.groups.io
> Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when 
> upgrade submodule.
> 
> Guomin,
> 
> I have two comments.
> 1. Please only descript the patch's function in the commit message.
> 2. The file attribute is not always the next line of the line starts 
> with "diff -- git"
> 
> Thanks,
> Bob
> 
> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: Tuesday, July 21, 2020 6:38 PM
> To: Gao, Liming <liming.gao@intel.com>; devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>
> Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when 
> upgrade submodule.
> 
> It is used to judge if the current change is for submodule.
> 
> The attribute of submodule is 160000, just like the file attribute of 
> file is 10644.
> 
> Normally, the changed file will begin with 'diff --git' and the next line like '
> index 954f66c056e..04300e71f38 100644' which end with the attribute, 
> and changed submodule is similar.
> 
> > -----Original Message-----
> > From: Gao, Liming <liming.gao@intel.com>
> > Sent: Tuesday, July 21, 2020 1:57 PM
> > To: Jiang, Guomin <guomin.jiang@intel.com>; devel@edk2.groups.io
> > Cc: Feng, Bob C <bob.c.feng@intel.com>
> > Subject: RE: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check 
> > when upgrade submodule.
> >
> > Guomin:
> >   +                   self.lines[self.line_num+1].endswith('160000\n') or
> >
> >   What means for this line?
> >
> >
> > Thanks
> > Liming
> > -----Original Message-----
> > From: Jiang, Guomin <guomin.jiang@intel.com>
> > Sent: 2020年7月21日 10:59
> > To: devel@edk2.groups.io
> > Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming 
> > <liming.gao@intel.com>
> > Subject: [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when 
> > upgrade submodule.
> >
> > When i upgrade openssl to 1.1.1g, error occurred when run PatchCheck.py.
> > The reason is that the submodule will end with LF, but it will check 
> > based on file rule, it make no sense and need ignore the check.
> >
> > Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> > Cc: Bob Feng <bob.c.feng@intel.com>
> > Cc: Liming Gao <liming.gao@intel.com>
> > ---
> >  BaseTools/Scripts/PatchCheck.py | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/BaseTools/Scripts/PatchCheck.py 
> > b/BaseTools/Scripts/PatchCheck.py index 7db0775d14d1..46b9936c6576
> > 100755
> > --- a/BaseTools/Scripts/PatchCheck.py
> > +++ b/BaseTools/Scripts/PatchCheck.py
> > @@ -405,12 +405,16 @@ class GitDiffCheck:
> >                      #
> >                      self.force_crlf = False
> >                  if self.filename == '.gitmodules' or \
> > +                   self.lines[self.line_num+1].endswith('160000\n')
> > + or \
> >                     self.filename == 'BaseTools/Conf/diff.order':
> >                      #
> >                      # .gitmodules and diff orderfiles are used internally by git
> >                      # use tabs and LF line endings.  Do not enforce no tabs and
> >                      # do not enforce CR/LF line endings.
> >                      #
> > +                    # When update submodule, it will encode with LF line and do
> > +                    # not enforce CR/LF line endings.
> > +                    #
> >                      self.force_crlf = False
> >                      self.force_notabs = False
> >              elif len(line.rstrip()) != 0:
> > --
> > 2.25.1.windows.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-07-22  7:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-21  2:58 [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule Guomin Jiang
2020-07-21  5:56 ` Liming Gao
2020-07-21 10:38   ` Guomin Jiang
2020-07-22  2:00     ` Liming Gao
2020-07-22  2:08     ` Bob Feng
2020-07-22  2:21       ` Guomin Jiang
2020-07-22  2:28         ` Bob Feng
2020-07-22  7:29           ` Liming Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox