git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: "Hebrock, Christoph" <ch@generationdesign.de>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Confusing note in "gitattributes text=auto" discription
Date: Mon, 9 May 2022 17:27:28 +0200	[thread overview]
Message-ID: <20220509152728.32kgmus6dht7uofn@tb-raspi4> (raw)
In-Reply-To: <AM6PR03MB5444D37306312CE538C9BD1BCAC69@AM6PR03MB5444.eurprd03.prod.outlook.com>

On Mon, May 09, 2022 at 10:59:08AM +0000, Hebrock, Christoph wrote:
> Dear Sir or Madam,
> I have a question about "gitattributes text".
>
> I find the sentence "When the file has been committed with CRLF, no conversion is done" somewhat confusing in the context descibed above.
> How is this possible when "text=auto" is active to commit/checkin CRLF?
>
> Set to string value "auto"
> When text is set to "auto", the path is marked for automatic end-of-line conversion. If Git decides that the content is text, its line endings are converted to LF on checkin.
> "When the file has been committed with CRLF, no conversion is done."

This is what happens in real live, and what we try to describe:
#On a Windows box:
mkdir test_repo
cd test_repo
git init
git config core.autocrlf false
printf 'REM my first BAT file\r\n' >test.bat
printf 'REM exit' >>test.bat
git add test.bat
git commit -m "Add test.bat"

git ls-files --eol
# Something in this style:
i/crlf w/crlf attr/            test.bat

Now the file has been commited with CRLF.

Does this answer the question ?




      reply	other threads:[~2022-05-09 15:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 10:59 Confusing note in "gitattributes text=auto" discription Hebrock, Christoph
2022-05-09 15:27 ` Torsten Bögershausen [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20220509152728.32kgmus6dht7uofn@tb-raspi4 \
    --to=tboegi@web.de \
    --cc=ch@generationdesign.de \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).