Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: EOL normalization? (Was: Completion script for the ctags program)



Lawrence Velázquez wrote on Mon, 29 Mar 2021 15:07 +00:00:
> On Mon, Mar 29, 2021, at 4:54 AM, Peter Stephenson wrote:
> > 
> > > On 29 March 2021 at 00:29 Oliver Kiddle <opk@xxxxxxx> wrote:
> > > The previous files also had DOS
> > > line endings - if someone other than me pushes any updates, please
> > > ensure we only have Unix line endings.
> > 
> > That would likely be my fault because on that occasion I extracted the script
> > from the original email in a somewhat clumsy cross-platform way.  It was
> > inconvenient and bug-prone enough I'm likely to be leaving anything like
> > this in future until I'm back on a proper Linux system...
> 
> Would it be desirable to normalize line endings on commit (see
> https://git-scm.com/docs/gitattributes#_end_of_line_conversion)?

I for one would rather Git treated file contents as opaque binary blobs
and didn't munge them in any way.  That tends to be a lot easier if we
ever need to surgery the repository, or if we want to add CRLF or binary
test data, or if somebody uses a Windows Git client to build zsh on
Cygwin — and as to downsides, it's not as though CRLF in the completion
files are a common problem, or one that's hard to notice/fix when it
does occur.

Cheers,

Daniel

> 
> 
> 
> diff --git a/.gitattributes b/.gitattributes
> new file mode 100644
> index 000000000..0a192b762
> --- /dev/null
> +++ b/.gitattributes
> @@ -0,0 +1,2 @@
> +# Normalize EOLs to LF in files that look like text.
> +* text=auto
> 
>




Messages sorted by: Reverse Date, Date, Thread, Author