git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Yagnatinsky\, Mark" <mark.yagnatinsky@bofa.com>
Cc: "'Torsten Bögershausen'" <tboegi@web.de>,
	"'git@vger.kernel.org'" <git@vger.kernel.org>
Subject: Re: suggestion for improved docs on autocrlf
Date: Mon, 12 Aug 2019 08:46:59 -0700	[thread overview]
Message-ID: <xmqqo90ubd3g.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <64c0a35825af4ff3956c6c9a5fb748bb@bofa.com> (Mark Yagnatinsky's message of "Mon, 12 Aug 2019 13:47:18 +0000")

"Yagnatinsky, Mark" <mark.yagnatinsky@bofa.com> writes:

> Wait a second... suppose a file is committed with CRLF line
> endings.  You're saying that even if I have autocrlf set to
> "input" or "auto", the file will never get "converted" to LF
> format unless I explicitly renormalize?  That sounds like a fairly
> sensible behavior, but it's not what I've observed in the past at
> all!  There have been plenty of times when I had "autocrlf" set to
> input which resulted in me changing line endings on commit I had
> no intention of changing!

Isn't that merely an effect of the fact that git add does not
bother with paths it knows unmodified, and the decision it makes if
a path is modified does not involve if the path's contents predate
what you have in the current .gitattributes and .git/config?

If you had committed two paths with CRLF, checked them out, flipped
the attribute so that they would be converted upon input, modified
one of them but not the other, and say "git add .", because the
relative age of .gitattributes and file contents do not get in the
picture, "git add ." would say "Ah, you have one modified file, so
we need to add its new contents to the index.  And you are telling
me to convert its line endings to LF while doing so."


  reply	other threads:[~2019-08-12 15:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07 13:08 suggestion for improved docs on autocrlf Yagnatinsky, Mark
2019-08-08 20:56 ` Torsten Bögershausen
2019-08-08 21:19   ` Yagnatinsky, Mark
2019-08-08 23:08     ` Yagnatinsky, Mark
2019-08-09  3:34       ` Torsten Bögershausen
2019-08-09 15:34         ` Yagnatinsky, Mark
2019-08-11 12:10           ` Torsten Bögershausen
2019-08-12 13:47             ` Yagnatinsky, Mark
2019-08-12 15:46               ` Junio C Hamano [this message]
2019-08-12 15:52                 ` Yagnatinsky, Mark
2019-08-12 17:10               ` Torsten Bögershausen
2019-08-12 18:00                 ` Yagnatinsky, Mark
2019-08-12 18:18                   ` Junio C Hamano
2019-08-12 18:30                     ` Yagnatinsky, Mark
2019-08-13  3:24                     ` Torsten Bögershausen
2019-08-13 15:31                       ` Yagnatinsky, Mark
2019-08-13 15:40                         ` Torsten Bögershausen
2019-08-13 15:44                           ` Yagnatinsky, Mark
2019-08-14 16:28                             ` Yagnatinsky, Mark
2019-08-15  4:56                               ` Yagnatinsky, Mark
2019-08-16  4:20                                 ` Torsten Bögershausen
2019-08-16 19:12                                   ` Yagnatinsky, Mark
2019-08-13 16:40                           ` 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

  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=xmqqo90ubd3g.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mark.yagnatinsky@bofa.com \
    --cc=tboegi@web.de \
    /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).