* [edk2-devel] [edk2-libc Patch 0/1] add .gitattributes to ensure right line endings in .sh .bat
@ 2024-07-12 14:27 Jayaprakash, N
2024-07-12 14:27 ` [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: " Jayaprakash, N
0 siblings, 1 reply; 10+ messages in thread
From: Jayaprakash, N @ 2024-07-12 14:27 UTC (permalink / raw)
To: devel; +Cc: Jayaprakash N
This commit adds the .gitattributes file to preserve
correct line endings for the files .sh and .bat irrespective
of the environment used by the developer.
Jayaprakash N (1):
edk2-libc: add .gitattributes to ensure right line endings in .sh .bat
.gitattributes | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 .gitattributes
--
2.45.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119911): https://edk2.groups.io/g/devel/message/119911
Mute This Topic: https://groups.io/mt/107182919/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 10+ messages in thread
* [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat
2024-07-12 14:27 [edk2-devel] [edk2-libc Patch 0/1] add .gitattributes to ensure right line endings in .sh .bat Jayaprakash, N
@ 2024-07-12 14:27 ` Jayaprakash, N
2024-07-12 15:58 ` Michael D Kinney
2024-07-12 20:03 ` Rebecca Cran
0 siblings, 2 replies; 10+ messages in thread
From: Jayaprakash, N @ 2024-07-12 14:27 UTC (permalink / raw)
To: devel; +Cc: Jayaprakash N, Rebecca Cran, Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4809
This commit adds .gitattributes file with the right settings
to preserve the correct line endings for .sh and .bat files
as per the Linxu and Windows line ending conventions
respectively.
Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jayaprakash N <n.jayaprakash@intel.com>
Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>
---
.gitattributes | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 .gitattributes
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..3fd9ec8
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+*.bat text eol=crlf
+*.sh text eol=lf
\ No newline at end of file
--
2.45.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119912): https://edk2.groups.io/g/devel/message/119912
Mute This Topic: https://groups.io/mt/107182920/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat
2024-07-12 14:27 ` [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: " Jayaprakash, N
@ 2024-07-12 15:58 ` Michael D Kinney
2024-07-12 16:47 ` Jayaprakash, N
2024-07-17 5:55 ` Jayaprakash, N
2024-07-12 20:03 ` Rebecca Cran
1 sibling, 2 replies; 10+ messages in thread
From: Michael D Kinney @ 2024-07-12 15:58 UTC (permalink / raw)
To: Jayaprakash, N, devel@edk2.groups.io, Leif Lindholm
Cc: Rebecca Cran, Kinney, Michael D
+ Leif
.gitattributes is not used in other TianoCore repos.
This feature changes the line endings locally when checked out.
Instead, the edk2 repo uses a CI check like PatchCheck.py to make
sure files with specific extensions have the correct line endings
when they are checked in and files are checked out unmodified.
I know Leif has been evaluating some line ending changes to TianoCore
Repos. Don't know if this direction is in alignment with those
ideas or not.
Mike
> -----Original Message-----
> From: Jayaprakash, N <n.jayaprakash@intel.com>
> Sent: Friday, July 12, 2024 7:27 AM
> To: devel@edk2.groups.io
> Cc: Jayaprakash, N <n.jayaprakash@intel.com>; Rebecca Cran
> <rebecca@bsdio.com>; Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right
> line endings in .sh .bat
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4809
>
> This commit adds .gitattributes file with the right settings
> to preserve the correct line endings for .sh and .bat files
> as per the Linxu and Windows line ending conventions
> respectively.
>
> Cc: Rebecca Cran <rebecca@bsdio.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Jayaprakash N <n.jayaprakash@intel.com>
> Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>
> ---
> .gitattributes | 2 ++
> 1 file changed, 2 insertions(+)
> create mode 100644 .gitattributes
>
> diff --git a/.gitattributes b/.gitattributes
> new file mode 100644
> index 0000000..3fd9ec8
> --- /dev/null
> +++ b/.gitattributes
> @@ -0,0 +1,2 @@
> +*.bat text eol=crlf
> +*.sh text eol=lf
> \ No newline at end of file
> --
> 2.45.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119913): https://edk2.groups.io/g/devel/message/119913
Mute This Topic: https://groups.io/mt/107182920/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat
2024-07-12 15:58 ` Michael D Kinney
@ 2024-07-12 16:47 ` Jayaprakash, N
2024-07-17 5:55 ` Jayaprakash, N
1 sibling, 0 replies; 10+ messages in thread
From: Jayaprakash, N @ 2024-07-12 16:47 UTC (permalink / raw)
To: Kinney, Michael D, devel@edk2.groups.io, Leif Lindholm; +Cc: Rebecca Cran
Thanks Mike.
Line endings have been a consistent problem creators for me for the .sh and .bat files while working on Python UEFI project.
At times I used to run dos2linux command to convert the .sh scripts line endings from \r\n format to \n format to fix the compilation issues on Linux.
So, thought of using the .gitattributes feature from github to normalize the line endings for these 2 types of text files.
Will wait to hear from Leif on the changes being evaluated for Tinocore repos on Line endings.
Regards,
JP
-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com>
Sent: Friday, July 12, 2024 9:29 PM
To: Jayaprakash, N <n.jayaprakash@intel.com>; devel@edk2.groups.io; Leif Lindholm <llindhol@qti.qualcomm.com>
Cc: Rebecca Cran <rebecca@bsdio.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: RE: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat
+ Leif
.gitattributes is not used in other TianoCore repos.
This feature changes the line endings locally when checked out.
Instead, the edk2 repo uses a CI check like PatchCheck.py to make sure files with specific extensions have the correct line endings when they are checked in and files are checked out unmodified.
I know Leif has been evaluating some line ending changes to TianoCore Repos. Don't know if this direction is in alignment with those ideas or not.
Mike
> -----Original Message-----
> From: Jayaprakash, N <n.jayaprakash@intel.com>
> Sent: Friday, July 12, 2024 7:27 AM
> To: devel@edk2.groups.io
> Cc: Jayaprakash, N <n.jayaprakash@intel.com>; Rebecca Cran
> <rebecca@bsdio.com>; Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure
> right line endings in .sh .bat
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4809
>
> This commit adds .gitattributes file with the right settings to
> preserve the correct line endings for .sh and .bat files as per the
> Linxu and Windows line ending conventions respectively.
>
> Cc: Rebecca Cran <rebecca@bsdio.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Jayaprakash N <n.jayaprakash@intel.com>
> Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>
> ---
> .gitattributes | 2 ++
> 1 file changed, 2 insertions(+)
> create mode 100644 .gitattributes
>
> diff --git a/.gitattributes b/.gitattributes new file mode 100644
> index 0000000..3fd9ec8
> --- /dev/null
> +++ b/.gitattributes
> @@ -0,0 +1,2 @@
> +*.bat text eol=crlf
> +*.sh text eol=lf
> \ No newline at end of file
> --
> 2.45.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119914): https://edk2.groups.io/g/devel/message/119914
Mute This Topic: https://groups.io/mt/107182920/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat
2024-07-12 14:27 ` [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: " Jayaprakash, N
2024-07-12 15:58 ` Michael D Kinney
@ 2024-07-12 20:03 ` Rebecca Cran
2024-07-15 18:14 ` Jayaprakash, N
1 sibling, 1 reply; 10+ messages in thread
From: Rebecca Cran @ 2024-07-12 20:03 UTC (permalink / raw)
To: devel, n.jayaprakash; +Cc: Michael D Kinney
On 7/12/24 08:27, Jayaprakash, N wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4809
>
> This commit adds .gitattributes file with the right settings
> to preserve the correct line endings for .sh and .bat files
> as per the Linxu and Windows line ending conventions
> respectively.
>
> Cc: Rebecca Cran <rebecca@bsdio.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Jayaprakash N <n.jayaprakash@intel.com>
> Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>
> ---
> .gitattributes | 2 ++
> 1 file changed, 2 insertions(+)
> create mode 100644 .gitattributes
>
> diff --git a/.gitattributes b/.gitattributes
> new file mode 100644
> index 0000000..3fd9ec8
> --- /dev/null
> +++ b/.gitattributes
> @@ -0,0 +1,2 @@
> +*.bat text eol=crlf
> +*.sh text eol=lf
> \ No newline at end of file
Could you also add .env to allow for files that set environment
variables sourced from scripts?
--
Rebecca Cran
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119919): https://edk2.groups.io/g/devel/message/119919
Mute This Topic: https://groups.io/mt/107182920/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat
2024-07-12 20:03 ` Rebecca Cran
@ 2024-07-15 18:14 ` Jayaprakash, N
0 siblings, 0 replies; 10+ messages in thread
From: Jayaprakash, N @ 2024-07-15 18:14 UTC (permalink / raw)
To: Rebecca Cran, devel@edk2.groups.io; +Cc: Kinney, Michael D
Thanks Rebecca for the feedback. I shall definitely add .env into the list.
Waiting for inputs from Leif as per Mike's suggestion.
Regards,
JP
-----Original Message-----
From: Rebecca Cran <rebecca@bsdio.com>
Sent: Saturday, July 13, 2024 1:34 AM
To: devel@edk2.groups.io; Jayaprakash, N <n.jayaprakash@intel.com>
Cc: Kinney, Michael D <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat
On 7/12/24 08:27, Jayaprakash, N wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4809
>
> This commit adds .gitattributes file with the right settings to
> preserve the correct line endings for .sh and .bat files as per the
> Linxu and Windows line ending conventions respectively.
>
> Cc: Rebecca Cran <rebecca@bsdio.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Jayaprakash N <n.jayaprakash@intel.com>
> Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>
> ---
> .gitattributes | 2 ++
> 1 file changed, 2 insertions(+)
> create mode 100644 .gitattributes
>
> diff --git a/.gitattributes b/.gitattributes new file mode 100644
> index 0000000..3fd9ec8
> --- /dev/null
> +++ b/.gitattributes
> @@ -0,0 +1,2 @@
> +*.bat text eol=crlf
> +*.sh text eol=lf
> \ No newline at end of file
Could you also add .env to allow for files that set environment variables sourced from scripts?
--
Rebecca Cran
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119937): https://edk2.groups.io/g/devel/message/119937
Mute This Topic: https://groups.io/mt/107182920/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat
2024-07-12 15:58 ` Michael D Kinney
2024-07-12 16:47 ` Jayaprakash, N
@ 2024-07-17 5:55 ` Jayaprakash, N
2024-07-17 14:24 ` Leif Lindholm
1 sibling, 1 reply; 10+ messages in thread
From: Jayaprakash, N @ 2024-07-17 5:55 UTC (permalink / raw)
To: Kinney, Michael D, devel@edk2.groups.io, Leif Lindholm; +Cc: Rebecca Cran
Hi Lefi,
Do you have any recommendations on this?
Regards,
JP
-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com>
Sent: Friday, July 12, 2024 9:29 PM
To: Jayaprakash, N <n.jayaprakash@intel.com>; devel@edk2.groups.io; Leif Lindholm <llindhol@qti.qualcomm.com>
Cc: Rebecca Cran <rebecca@bsdio.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: RE: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat
+ Leif
.gitattributes is not used in other TianoCore repos.
This feature changes the line endings locally when checked out.
Instead, the edk2 repo uses a CI check like PatchCheck.py to make sure files with specific extensions have the correct line endings when they are checked in and files are checked out unmodified.
I know Leif has been evaluating some line ending changes to TianoCore Repos. Don't know if this direction is in alignment with those ideas or not.
Mike
> -----Original Message-----
> From: Jayaprakash, N <n.jayaprakash@intel.com>
> Sent: Friday, July 12, 2024 7:27 AM
> To: devel@edk2.groups.io
> Cc: Jayaprakash, N <n.jayaprakash@intel.com>; Rebecca Cran
> <rebecca@bsdio.com>; Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure
> right line endings in .sh .bat
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4809
>
> This commit adds .gitattributes file with the right settings to
> preserve the correct line endings for .sh and .bat files as per the
> Linxu and Windows line ending conventions respectively.
>
> Cc: Rebecca Cran <rebecca@bsdio.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Jayaprakash N <n.jayaprakash@intel.com>
> Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>
> ---
> .gitattributes | 2 ++
> 1 file changed, 2 insertions(+)
> create mode 100644 .gitattributes
>
> diff --git a/.gitattributes b/.gitattributes new file mode 100644
> index 0000000..3fd9ec8
> --- /dev/null
> +++ b/.gitattributes
> @@ -0,0 +1,2 @@
> +*.bat text eol=crlf
> +*.sh text eol=lf
> \ No newline at end of file
> --
> 2.45.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119946): https://edk2.groups.io/g/devel/message/119946
Mute This Topic: https://groups.io/mt/107182920/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat
2024-07-17 5:55 ` Jayaprakash, N
@ 2024-07-17 14:24 ` Leif Lindholm
2024-07-18 6:47 ` Jayaprakash, N
0 siblings, 1 reply; 10+ messages in thread
From: Leif Lindholm @ 2024-07-17 14:24 UTC (permalink / raw)
To: devel, n.jayaprakash, Kinney, Michael D; +Cc: Rebecca Cran
Hi,
The address I am replying from is the email address I use for tianocore
work. Messages sent elsewhere are going to end up misfiled and likely lost.
On 2024-07-17 06:55, Jayaprakash, N wrote:
> Hi Lefi,
>
> Do you have any recommendations on this?
>
> Regards,
> JP
>
> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Friday, July 12, 2024 9:29 PM
> To: Jayaprakash, N <n.jayaprakash@intel.com>; devel@edk2.groups.io; Leif Lindholm <llindhol@qti.qualcomm.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>; Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: RE: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat
>
> + Leif
>
> .gitattributes is not used in other TianoCore repos.
Technically sort of correct, but see below.
> This feature changes the line endings locally when checked out.
>
> Instead, the edk2 repo uses a CI check like PatchCheck.py to make sure files with specific extensions have the correct line endings when they are checked in and files are checked out unmodified.
>
> I know Leif has been evaluating some line ending changes to TianoCore Repos. Don't know if this direction is in alignment with those ideas or not.
>
> Mike
>
>> -----Original Message-----
>> From: Jayaprakash, N <n.jayaprakash@intel.com>
>> Sent: Friday, July 12, 2024 7:27 AM
>> To: devel@edk2.groups.io
>> Cc: Jayaprakash, N <n.jayaprakash@intel.com>; Rebecca Cran
>> <rebecca@bsdio.com>; Kinney, Michael D <michael.d.kinney@intel.com>
>> Subject: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure
>> right line endings in .sh .bat
>>
>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4809
>>
>> This commit adds .gitattributes file with the right settings to
>> preserve the correct line endings for .sh and .bat files as per the
>> Linxu and Windows line ending conventions respectively.
>>
>> Cc: Rebecca Cran <rebecca@bsdio.com>
>> Cc: Michael D Kinney <michael.d.kinney@intel.com>
>> Cc: Jayaprakash N <n.jayaprakash@intel.com>
>> Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>
>> ---
>> .gitattributes | 2 ++
>> 1 file changed, 2 insertions(+)
>> create mode 100644 .gitattributes
>>
>> diff --git a/.gitattributes b/.gitattributes new file mode 100644
>> index 0000000..3fd9ec8
>> --- /dev/null
>> +++ b/.gitattributes
>> @@ -0,0 +1,2 @@
>> +*.bat text eol=crlf
>> +*.sh text eol=lf
>> \ No newline at end of file
^ This is not a good look for any submission, but especially not one
dealing with line endings. Please manually look at patches before
sending them out.
Now, as for the suggestion: this isn't wrong, but can you explain what
problem it is solving?
I had a look in edk2-libc and all the .sh files have LF line endings and
all the .bat files have CRLF line endings.
Now, if we *did* want to do this, I would strongly prefer a patch to
edk2/BaseTools/Conf/gitattributes, which is applied in any repo
SetupGit.py has been executed in.
But ultimately I want to convert the repos completely to LF line endings
except for where special cases exist (which *should* be described in
[.]gitattributes) and then move to enable core.autocrlf.
/
Leif
>> --
>> 2.45.1.windows.1
>
>
>
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119953): https://edk2.groups.io/g/devel/message/119953
Mute This Topic: https://groups.io/mt/107182920/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat
2024-07-17 14:24 ` Leif Lindholm
@ 2024-07-18 6:47 ` Jayaprakash, N
2024-07-18 17:55 ` Leif Lindholm
0 siblings, 1 reply; 10+ messages in thread
From: Jayaprakash, N @ 2024-07-18 6:47 UTC (permalink / raw)
To: Leif Lindholm, devel@edk2.groups.io, Kinney, Michael D; +Cc: Rebecca Cran
Regarding the below comment from Lief.
Now, as for the suggestion: this isn't wrong, but can you explain what problem it is solving?
<<JP>> As a developer and also as a maintainer the lines endings have been a consistent problem as I have seen patches coming with mixed line endings some times it take quite a while to fix these simple line ending issues.
I want to start small through .gtiattributes usage for the .sh and .bat scripts to normalize the line endings to LF so that irrespective of the user environment the line endings are always stored as LF in git repo but presented to the users in LF or CRLF as per their environment. Thought of using this feature of github in a lower scale to make it easy for the developers and maintainers of the edk2-libc project.
If there is a general alignment that this change need not go, then I will close the BZ as won't fix.
Regards,
JP
-----Original Message-----
From: Leif Lindholm <quic_llindhol@quicinc.com>
Sent: Wednesday, July 17, 2024 7:55 PM
To: devel@edk2.groups.io; Jayaprakash, N <n.jayaprakash@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat
Hi,
The address I am replying from is the email address I use for tianocore work. Messages sent elsewhere are going to end up misfiled and likely lost.
On 2024-07-17 06:55, Jayaprakash, N wrote:
> Hi Lefi,
>
> Do you have any recommendations on this?
>
> Regards,
> JP
>
> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Friday, July 12, 2024 9:29 PM
> To: Jayaprakash, N <n.jayaprakash@intel.com>; devel@edk2.groups.io;
> Leif Lindholm <llindhol@qti.qualcomm.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>
> Subject: RE: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to
> ensure right line endings in .sh .bat
>
> + Leif
>
> .gitattributes is not used in other TianoCore repos.
Technically sort of correct, but see below.
> This feature changes the line endings locally when checked out.
>
> Instead, the edk2 repo uses a CI check like PatchCheck.py to make sure files with specific extensions have the correct line endings when they are checked in and files are checked out unmodified.
>
> I know Leif has been evaluating some line ending changes to TianoCore Repos. Don't know if this direction is in alignment with those ideas or not.
>
> Mike
>
>> -----Original Message-----
>> From: Jayaprakash, N <n.jayaprakash@intel.com>
>> Sent: Friday, July 12, 2024 7:27 AM
>> To: devel@edk2.groups.io
>> Cc: Jayaprakash, N <n.jayaprakash@intel.com>; Rebecca Cran
>> <rebecca@bsdio.com>; Kinney, Michael D <michael.d.kinney@intel.com>
>> Subject: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to
>> ensure right line endings in .sh .bat
>>
>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4809
>>
>> This commit adds .gitattributes file with the right settings to
>> preserve the correct line endings for .sh and .bat files as per the
>> Linxu and Windows line ending conventions respectively.
>>
>> Cc: Rebecca Cran <rebecca@bsdio.com>
>> Cc: Michael D Kinney <michael.d.kinney@intel.com>
>> Cc: Jayaprakash N <n.jayaprakash@intel.com>
>> Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>
>> ---
>> .gitattributes | 2 ++
>> 1 file changed, 2 insertions(+)
>> create mode 100644 .gitattributes
>>
>> diff --git a/.gitattributes b/.gitattributes new file mode 100644
>> index 0000000..3fd9ec8
>> --- /dev/null
>> +++ b/.gitattributes
>> @@ -0,0 +1,2 @@
>> +*.bat text eol=crlf
>> +*.sh text eol=lf
>> \ No newline at end of file
^ This is not a good look for any submission, but especially not one dealing with line endings. Please manually look at patches before sending them out.
Now, as for the suggestion: this isn't wrong, but can you explain what problem it is solving?
I had a look in edk2-libc and all the .sh files have LF line endings and all the .bat files have CRLF line endings.
Now, if we *did* want to do this, I would strongly prefer a patch to edk2/BaseTools/Conf/gitattributes, which is applied in any repo SetupGit.py has been executed in.
But ultimately I want to convert the repos completely to LF line endings except for where special cases exist (which *should* be described in
[.]gitattributes) and then move to enable core.autocrlf.
/
Leif
>> --
>> 2.45.1.windows.1
>
>
>
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119965): https://edk2.groups.io/g/devel/message/119965
Mute This Topic: https://groups.io/mt/107182920/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat
2024-07-18 6:47 ` Jayaprakash, N
@ 2024-07-18 17:55 ` Leif Lindholm
0 siblings, 0 replies; 10+ messages in thread
From: Leif Lindholm @ 2024-07-18 17:55 UTC (permalink / raw)
To: Jayaprakash, N, devel@edk2.groups.io, Kinney, Michael D; +Cc: Rebecca Cran
On 2024-07-18 07:47, Jayaprakash, N wrote:
> Regarding the below comment from Lief.
>
> Now, as for the suggestion: this isn't wrong, but can you explain what problem it is solving?
>
> <<JP>> As a developer and also as a maintainer the lines endings have been
> a consistent problem as I have seen patches coming with mixed line > endings some times it take quite a while to fix these simple line>
ending issues.
I agree it's annoying, but if it takes a noticeable amount of time to
fix, it sounds to me like you're manually editing things that tools can
do for you. (Admittedly, git is one of those tools.) And as Mike says,
there's the helper scripts and CI.
> I want to start small through .gtiattributes usage for the .sh and
> .bat scripts to normalize the line endings to LF so that irrespective
> of the user environment the line endings are always stored as LF in
> git repo but presented to the users in LF or CRLF as per their
> environment. Thought of using this feature of github in a lower scale
> to make it easy for the developers and maintainers of the edk2-libc project.
>
> If there is a general alignment that this change need not go,
> then I will close the BZ as won't fix.
Like I said, there's nothing actually *wrong* about doing what you
propose. It's more a question of how we maintain (or not) consistency
between, and within, the repos.
Do we keep edk2-libc as a special thing on the side?
If so I guess it could keep its own .gitattributes.
If not, it should use the one in edk2/BaseTools.
If so, that affects all the repos.
If it affects all the repos, why specifically .sh and .bat?
Yes, it doesn't break the build if it sneaks into a .c file, or a .inf,
but it breaks CI. Sometimes. So should we specify .c, .h, .inf, .dsc,
.dec, .py, .vfr as well?
As it stands, I'd prefer to leave this alone until do the CRLF->LF
conversion and can migrate to core.autocrlf=auto. At that point, I
expect most of these mixups will go away. And if they don't, we could
always revisit then.
I do intend to get back to the CRLF->LF conversion work once the shock
from the Github-PR switch has settled.
Regards,
Leif
> Regards,
> JP
>
> -----Original Message-----
> From: Leif Lindholm <quic_llindhol@quicinc.com>
> Sent: Wednesday, July 17, 2024 7:55 PM
> To: devel@edk2.groups.io; Jayaprakash, N <n.jayaprakash@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>
> Subject: Re: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to ensure right line endings in .sh .bat
>
> Hi,
>
> The address I am replying from is the email address I use for tianocore work. Messages sent elsewhere are going to end up misfiled and likely lost.
>
> On 2024-07-17 06:55, Jayaprakash, N wrote:
>> Hi Lefi,
>>
>> Do you have any recommendations on this?
>>
>> Regards,
>> JP
>>
>> -----Original Message-----
>> From: Kinney, Michael D <michael.d.kinney@intel.com>
>> Sent: Friday, July 12, 2024 9:29 PM
>> To: Jayaprakash, N <n.jayaprakash@intel.com>; devel@edk2.groups.io;
>> Leif Lindholm <llindhol@qti.qualcomm.com>
>> Cc: Rebecca Cran <rebecca@bsdio.com>; Kinney, Michael D
>> <michael.d.kinney@intel.com>
>> Subject: RE: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to
>> ensure right line endings in .sh .bat
>>
>> + Leif
>>
>> .gitattributes is not used in other TianoCore repos.
>
> Technically sort of correct, but see below.
>
>> This feature changes the line endings locally when checked out.
>>
>> Instead, the edk2 repo uses a CI check like PatchCheck.py to make sure files with specific extensions have the correct line endings when they are checked in and files are checked out unmodified.
>>
>> I know Leif has been evaluating some line ending changes to TianoCore Repos. Don't know if this direction is in alignment with those ideas or not.
>>
>> Mike
>>
>>> -----Original Message-----
>>> From: Jayaprakash, N <n.jayaprakash@intel.com>
>>> Sent: Friday, July 12, 2024 7:27 AM
>>> To: devel@edk2.groups.io
>>> Cc: Jayaprakash, N <n.jayaprakash@intel.com>; Rebecca Cran
>>> <rebecca@bsdio.com>; Kinney, Michael D <michael.d.kinney@intel.com>
>>> Subject: [edk2-libc Patch 1/1] edk2-libc: add .gitattributes to
>>> ensure right line endings in .sh .bat
>>>
>>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4809
>>>
>>> This commit adds .gitattributes file with the right settings to
>>> preserve the correct line endings for .sh and .bat files as per the
>>> Linxu and Windows line ending conventions respectively.
> >>
>>> Cc: Rebecca Cran <rebecca@bsdio.com>
>>> Cc: Michael D Kinney <michael.d.kinney@intel.com>
>>> Cc: Jayaprakash N <n.jayaprakash@intel.com>
>>> Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>
>>> ---
>>> .gitattributes | 2 ++
>>> 1 file changed, 2 insertions(+)
>>> create mode 100644 .gitattributes
>>>
>>> diff --git a/.gitattributes b/.gitattributes new file mode 100644
>>> index 0000000..3fd9ec8
>>> --- /dev/null
>>> +++ b/.gitattributes
>>> @@ -0,0 +1,2 @@
>>> +*.bat text eol=crlf
>>> +*.sh text eol=lf
>>> \ No newline at end of file
>
> ^ This is not a good look for any submission, but especially not one dealing with line endings. Please manually look at patches before sending them out.
>
> Now, as for the suggestion: this isn't wrong, but can you explain what problem it is solving?
>
> I had a look in edk2-libc and all the .sh files have LF line endings and all the .bat files have CRLF line endings.
>
> Now, if we *did* want to do this, I would strongly prefer a patch to edk2/BaseTools/Conf/gitattributes, which is applied in any repo SetupGit.py has been executed in.
>
> But ultimately I want to convert the repos completely to LF line endings except for where special cases exist (which *should* be described in
> [.]gitattributes) and then move to enable core.autocrlf.
>
> /
> Leif
>
>>> --
>>> 2.45.1.windows.1
>>
>>
>>
>>
>>
>>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119973): https://edk2.groups.io/g/devel/message/119973
Mute This Topic: https://groups.io/mt/107182920/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-07-18 17:55 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-12 14:27 [edk2-devel] [edk2-libc Patch 0/1] add .gitattributes to ensure right line endings in .sh .bat Jayaprakash, N
2024-07-12 14:27 ` [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: " Jayaprakash, N
2024-07-12 15:58 ` Michael D Kinney
2024-07-12 16:47 ` Jayaprakash, N
2024-07-17 5:55 ` Jayaprakash, N
2024-07-17 14:24 ` Leif Lindholm
2024-07-18 6:47 ` Jayaprakash, N
2024-07-18 17:55 ` Leif Lindholm
2024-07-12 20:03 ` Rebecca Cran
2024-07-15 18:14 ` Jayaprakash, N
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox