[edk2-devel] [PATCH 1/1] BaseTools/Scripts: Ignore the CRLF check when upgrade submodule.

Guomin Jiang guomin.jiang at intel.com
Wed Jul 22 02:21:08 UTC 2020


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 at intel.com>
> Sent: Wednesday, July 22, 2020 10:08 AM
> To: Jiang, Guomin <guomin.jiang at intel.com>; Gao, Liming
> <liming.gao at intel.com>; devel at 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 at intel.com>
> Sent: Tuesday, July 21, 2020 6:38 PM
> To: Gao, Liming <liming.gao at intel.com>; devel at edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng at 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 at intel.com>
> > Sent: Tuesday, July 21, 2020 1:57 PM
> > To: Jiang, Guomin <guomin.jiang at intel.com>; devel at edk2.groups.io
> > Cc: Feng, Bob C <bob.c.feng at 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 at intel.com>
> > Sent: 2020年7月21日 10:59
> > To: devel at edk2.groups.io
> > Cc: Feng, Bob C <bob.c.feng at intel.com>; Gao, Liming
> > <liming.gao at 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 at intel.com>
> > Cc: Bob Feng <bob.c.feng at intel.com>
> > Cc: Liming Gao <liming.gao at 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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#63047): https://edk2.groups.io/g/devel/message/63047
Mute This Topic: https://groups.io/mt/75697127/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list