Re: Unresolved issues
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Feb 21, 2007, 17:05 UTC
- Message-ID
- <20070221170539.GI25559@spearce.org>
- In-Reply-To
- <09D527A1-43E2-41A1-AC46-71F64BC409C2@silverinsanity.com>
Brian Gernhardt <benji@silverinsanity.com> wrote:
Show 17 quoted lines
> It seems to me that a tracked .gitattributes file should have things > like > > *.txt: text > *.gif: binary > *.[ch]: text > > And the .git/config should have > > [attribute "text"] > mangle = crlf > > [attribute "binary"] > merge = none > > The type of each file should be tracked, but what to do with each > type is a local issue. Trying to merge the two is madness.
Yes, exactly. :-)
I would also recommend that we encourage use of standard MIME types to define the file types, but don't enforce it. Thus I can setup something like:
cat >.gitattributes <<EOF *.txt: text/plain *.java: text/java-source *.xml: text/xml *.bin: mycompany-binary EOF
cat >>.git/config <<EOF
[attribute "text/*"]
mangle = crlf
[attribute "text/xml"]
merge = better-xml-mergething
[attribute "mycompany-binary"]
mangle = no
merge = mycompany-binarymerge
EOFAnd have all three classes of files be mangled with CRLF, but XML files are also merged with the external merge process, and the special type mycompany-binary might be a local file format that comes with its own merge tools, but is not exactly a registered MIME type.
One advantage here is we can setup attribute.text/*.mangle=crlf on Windows platforms by default for users, as we can reasonably assume all text content falls into this MIME type...
-- Shawn.