Git development
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Cc: messester <cnotsomark@gmail.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Potential bug: Git instantly converts utf-8-bom to utf-8
Date: Mon, 14 Apr 2025 20:03:38 +0200	[thread overview]
Message-ID: <20250414180338.GA2398@tb-raspi4> (raw)
In-Reply-To: <A743D2B5-0397-4AF3-899B-FC3D3AD2B5CB@gmail.com>

On Mon, Apr 14, 2025 at 02:19:05PM -0300, Lucas Seiki Oshiro wrote:
>
> > When I clone the git repository https://github.com/NinekoTheCat/infinilore.cs.git into an empty directory and run git status it shows changes where all the files are deleted and then added again.
>
> I tried here. I'm in a Mac, it shows that several file changes.
>
> > The difference seems to be in the first line as opening it in a text editor aware of encodings shows the change from utf-8-bom to utf-8.
>
> Given the warning messages it looks like it is more related
> to CRLF/LF than to UTF-8.
>
> At least here, for example, the listed modified '*.cs' files
> are the ones that ends their lines in CRLF. This is, running:
>
> ```
> file $(git ls-files '*.cs') | grep CRLF | cut -d ':' -f1 | sort
> ```
>
> shows me the same files as
>
> ```
> git status '*.cs'
> ```
>
> You can also see that are some '*.cs' files that are not
> CRLF-terminated by running:
>
> ```
> file $(git ls-files '*.cs') | grep -v CRLF | sort
> ```
>
> > I'd be very very grateful if anyone could explain what's going on and have a solution.<patch.cat>
>
> Perhaps a solution is:
>
> - Define a CRLF or LF as a standard
> - Convert all the files that don't follow the standard that you
>   have chosen to the one that you have chosen
> - Declare it in the .gitattributes file
>
> Hope that it helps you!

I think that this is already done :-)
However, the repo must be normalized:

git add --renormalize .

will do that.


  reply	other threads:[~2025-04-14 18:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14 15:59 Potential bug: Git instantly converts utf-8-bom to utf-8 messester
2025-04-14 17:19 ` Lucas Seiki Oshiro
2025-04-14 18:03   ` Torsten Bögershausen [this message]
2025-04-14 19:28     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250414180338.GA2398@tb-raspi4 \
    --to=tboegi@web.de \
    --cc=cnotsomark@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=lucasseikioshiro@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox