сб, 24 янв. 2026 г. в 21:59, William Lallemand <[email protected]>:

> On Sat, Jan 24, 2026 at 08:20:11PM +0100, Илья Шипицин wrote:
> > it is not a problem.
> > you can specify either
> >
> > * text=auto
> >
> > pr (for some files)
> >
> > *.c text=crlf
> >
> > and line ending will be handled as you;ve specified in .gitattributes
> > no need to blame developers on windows for not configuring line endings.
> >
>
> I'm not blaming anyone, but that's not the point, there are cases where you
> need both LF and CRLF lines, and if you're not seeing them you won't get
> what's
> going on in the file. I don't think trying to automate the conversion is a
> good
> idea, maybe we could put the .c and .h in lf mode.
>

*.c and *.h seem to be good with "text=auto"


>
> > I sent a patch previously which accidentally changed line endings in
> *.http
> > files. I agree that per RFC line ending is supposed to be CRLF, but Willy
> > told "You don't see them, but it has added CRs at the end of each line
> above
> > for no reason.", I do not argue with Willy :)
>
> I agree with Willy on this patch review, and I think you are missing the
> problem :
>
>         % cat -e examples/errorfiles/400.http
>         HTTP/1.0 400 Bad request^M$
>         Cache-Control: no-cache^M$
>         Connection: close^M$
>         Content-Type: text/html^M$
>         ^M$
>         <html><body><h1>400 Bad request</h1>$
>         Your browser sent an invalid request.$
>         </body></html>$
>         $
>
> Your patch converted the LF from the body to CRLF. These files already had
> CRLF
> lines for headers, and LF for the body. So if your editor does not show
> them,
> you won't be able to edit the file correctly. An automatic conversion can't
> help you there since it's a mix of both.
>

mix can be handled with "*.http binary" maybe, but let us postpone this


>
> > we can set crlf if it appropriate (to prevent accident line ending
> convertion)
>
> I don't think it is useful unfortunately.
>

mix of LF and CRLF is not handled in my opinion (in automatic manner)


>
> Regards,
>
> --
> William Lallemand
>

Reply via email to