From: Michael J Gruber <git@drmicha.warpmail.net>
To: git@vger.kernel.org
Cc: Michael J Gruber <git@drmicha.warpmail.net>
Subject: [PATCH/RFC] Introduce a built-in attribute "text"
Date: Fri, 24 Oct 2008 15:55:47 +0200 [thread overview]
Message-ID: <1224856547-30533-1-git-send-email-git@drmicha.warpmail.net> (raw)
"text is the opposite of "binary": It sets the attributes "crlf" and
"diff". It is needed because attribute macros can't be negated,
and some users may want to force git into treating certain files as
text which are not recognized by the internal logic.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
This gives the user the chance to mess up completely (given an
"appropriate" setting of autocrlf), but I still think it's a good idea
to have that "-binary" built-in. attributes aren't used by noobs anyways.
In many cases, "diff" might be preferred over "text". Should I add a warning
to the doc?
Michael
Documentation/gitattributes.txt | 4 +++-
attr.c | 1 +
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index 2694559..2a00f8c 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -510,7 +510,9 @@ the same time. The system knows a built-in attribute macro, `binary`:
which is equivalent to the above. Note that the attribute macros can only
be "Set" (see the above example that sets "binary" macro as if it were an
ordinary attribute --- setting it in turn unsets "crlf" and "diff").
-
+Therefore, there is also a built-in attribute macro `text` which allows
+you to mark certain files as text which git does not recognize automatically.
+It is equivalent to setting `crlf diff`.
DEFINING ATTRIBUTE MACROS
-------------------------
diff --git a/attr.c b/attr.c
index 17f6a4d..63e2837 100644
--- a/attr.c
+++ b/attr.c
@@ -283,6 +283,7 @@ static void free_attr_elem(struct attr_stack *e)
static const char *builtin_attr[] = {
"[attr]binary -diff -crlf",
+ "[attr]text diff crlf",
NULL,
};
--
1.6.0.3.514.g2f91b
next reply other threads:[~2008-10-24 13:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-24 13:55 Michael J Gruber [this message]
2008-10-25 6:51 ` Re* [PATCH/RFC] Introduce a built-in attribute "text" 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=1224856547-30533-1-git-send-email-git@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--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 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 NNTP newsgroup(s).