All of lore.kernel.org
 help / color / mirror / Atom feed
From: tboegi@web.de
To: git@vger.kernel.org
Cc: "Torsten Bögershausen" <tboegi@web.de>
Subject: [PATCH v1 2/2] gitattributes: Document the unified "auto" handling
Date: Thu, 25 Aug 2016 17:52:58 +0200	[thread overview]
Message-ID: <20160825155258.29007-1-tboegi@web.de> (raw)
In-Reply-To: <20160809114938.pcrvirrzrh6ldmnr@sigill.intra.peff.net>

From: Torsten Bögershausen <tboegi@web.de>

Update the documentation about text=auto:
text=auto now follows the core.autocrlf handling when files are not
normalized in the repository.

For a cross platform project recommend the usage of attributes for
line-ending conversions.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
 Documentation/gitattributes.txt | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index 807577a..4012661 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -213,27 +213,35 @@ that text files that you introduce to the repository have their line
 endings normalized to LF when they are added, and that files that are
 already normalized in the repository stay normalized.
 
+If you want to ensure that text files that any contributor introduces to
+the repository have their line endings normalized, you could set the
+`text` attribute to "auto" for _all_ files.
+
+------------------------
+*	text=auto
+------------------------
+
 If you want to interoperate with a source code management system that
 enforces end-of-line normalization, or you simply want all text files
 in your repository to be normalized, you should instead set the `text`
-attribute to "auto" for _all_ files.
+attribute to "text" for text files.
 
 ------------------------
-*	text=auto
+*.txt	text
 ------------------------
 
-This ensures that all files that Git considers to be text will have
+This ensures that all files marked as text will have
 normalized (LF) line endings in the repository.  The `core.eol`
 configuration variable controls which line endings Git will use for
 normalized files in your working directory; the default is to use the
 native line ending for your platform, or CRLF if `core.autocrlf` is
 set.
 
-NOTE: When `text=auto` normalization is enabled in an existing
-repository, any text files containing CRLFs should be normalized.  If
-they are not they will be normalized the next time someone tries to
-change them, causing unfortunate misattribution.  From a clean working
-directory:
+NOTE: When you have a cross-platform project using push and pull
+to a central repository the text files containing CRLFs should be
+normalized. All text files should have a text attribute, either
+`text` or `text=auto`.
+From a clean working directory:
 
 -------------------------------------------------
 $ echo "* text=auto" >>.gitattributes
-- 
2.9.3.599.g2376d31.dirty


  parent reply	other threads:[~2016-08-25 15:43 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08 15:05 t0027 racy? Johannes Schindelin
2016-08-08 15:29 ` Jeff King
2016-08-08 20:32   ` Torsten Bögershausen
2016-08-09  6:51     ` Jeff King
2016-08-09  7:03       ` Jeff King
2016-08-09 11:27         ` Johannes Schindelin
2016-08-09 11:33       ` Torsten Bögershausen
2016-08-09 11:49         ` Jeff King
2016-08-09 12:59           ` Torsten Bögershausen
2016-08-09 13:27             ` Jeff King
2016-08-09 21:28               ` Torsten Bögershausen
2016-08-10 12:28                 ` Johannes Schindelin
2016-08-11 18:58                   ` Torsten Bögershausen
2016-08-11 19:34                     ` Junio C Hamano
2016-08-12  7:24                     ` Jeff King
2016-08-12 16:50           ` [PATCH v1 0/2] Fix conversion warnings tboegi
2016-08-12 16:51           ` [PATCH v1 1/2] t0027: Correct raciness in NNO test tboegi
2016-08-12 17:56             ` Junio C Hamano
2016-08-13 16:50             ` Johannes Sixt
2016-08-13 21:18               ` Torsten Bögershausen
2016-08-14 20:37                 ` Junio C Hamano
2016-08-12 16:51           ` [PATCH v1 2/2] convert: missing `LF will be replaced by CRLF tboegi
2016-08-12 17:52             ` Junio C Hamano
2016-08-13 21:29           ` [PATCH v2 0/1] convert: Correct NNO tests and missing `LF will be replaced by CRLF` tboegi
2016-08-17 12:46             ` Johannes Schindelin
2016-08-13 21:29           ` [PATCH v2 1/1] " tboegi
2016-08-19  9:41           ` [PATCH v1 0/1] Rename NotNormalized (NNO) into CRLF in index tboegi
2016-08-19 16:39             ` Junio C Hamano
2016-08-19  9:41           ` [PATCH v1 1/1] t0027: " tboegi
2016-08-25 15:52           ` [PATCH v1 0/3] Update eol documentation tboegi
2016-08-25 20:31             ` Junio C Hamano
2016-08-26  1:00               ` Jacob Keller
2016-08-26  7:03               ` Torsten Bögershausen
2016-08-25 15:52           ` [PATCH v1 1/2] git ls-files: text=auto eol=lf is supported in Git 2.10 tboegi
2016-08-25 20:38             ` Junio C Hamano
2016-08-25 15:52           ` tboegi [this message]
2016-08-25 20:46             ` [PATCH v1 2/2] gitattributes: Document the unified "auto" handling Junio C Hamano
2016-08-26 20:18               ` [PATCH v2 0/2] Adjust the documentation to " tboegi
2016-08-26 20:18               ` [PATCH v2 1/2] git ls-files: text=auto eol=lf is supported in Git 2.10 tboegi
2016-08-26 20:18               ` [PATCH v2 2/2] gitattributes: Document the unified "auto" handling tboegi
2016-08-26 20:53                 ` Junio C Hamano
2016-08-09 11:33   ` t0027 racy? Johannes Schindelin
2016-08-09 11:38     ` Jeff King
2016-08-08 18:24 ` Torsten Bögershausen
2016-08-09 11:25   ` Johannes Schindelin

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=20160825155258.29007-1-tboegi@web.de \
    --to=tboegi@web.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.