From: bdowning@lavos.net (Brian Downing)
To: Steffen Prohaska <prohaska@zib.de>
Cc: gitster@pobox.com, dmitry.kakurin@gmail.com, git@vger.kernel.org
Subject: Re: [PATCH 1/2] attr: fix attribute handling if .gitattributes is involved
Date: Sun, 12 Aug 2007 20:51:15 -0500 [thread overview]
Message-ID: <20070813015115.GI21692@lavos.net> (raw)
In-Reply-To: <11869508753328-git-send-email-prohaska@zib.de>
On Sun, Aug 12, 2007 at 10:34:34PM +0200, Steffen Prohaska wrote:
> This together with the patch that follows fixes a problem, which
> is most likely to bite Windows users. I recognized it by setting
> autocrlf globally to true and doing a fresh checkout of msysgit.
> The checkout contained etc/termcap converted to CRLF, although
> is was marked as '-crlf' in etc/.gitattributes.
>
> If we believe autocrlf is a reasonable default for Windows users,
> we really should use it ourselves, to find such problems.
>
> The fixed problem is not really critical but may be quite annoying,
> and complex to understand.
I have a case in a live repository where this is not merely annoying.
I have a test data in one of my repositories that must never be
converted. It has a mix of Unix and Windows line-endings in it. I
marked the appropriate files with the "-crlf" attribute.
With the current git behavior, cloning this repository with "autocrlf"
globally set irreversably corrupts the files (converting the LF
line-enders to CRLF) on checkout. If the user is careless upon commit,
these corrupted files will then be committed back (probably with all
CRLFs, since at that point the .gitattributes is present and the -crlf
attribute will be honored.)
There is kind of an ugly chicken-and-egg problem here, but I think it
would be good to figure it out to avoid this kind of broken behavior.
I would also vote for this handling to be in the plumbing, since the
autocrlf processing is in the plumbing as well.
Another thing to consider with respect to attribute access -- It would
be nice for git-cvsserver to be able to send the correct -k option to
the remote side for line endings. Doing this correctly involves
accessing attributes, but git-cvsserver never has a full working
directory. Having the attribute machinery work without a working
directory (either directly from trees or from an index) would be a great
benefit here.
-bcd
prev parent reply other threads:[~2007-08-13 1:51 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-12 20:34 [PATCH 1/2] attr: fix attribute handling if .gitattributes is involved Steffen Prohaska
2007-08-12 20:34 ` [PATCH 2/2] checkout: fix attribute handling in checkout all Steffen Prohaska
2007-08-12 21:50 ` Junio C Hamano
2007-08-12 22:26 ` Steffen Prohaska
2007-08-13 6:14 ` Junio C Hamano
2007-08-13 6:32 ` Marius Storm-Olsen
2007-08-13 6:50 ` Steffen Prohaska
2007-08-13 7:15 ` Marius Storm-Olsen
2007-08-13 7:32 ` Steffen Prohaska
2007-08-13 8:39 ` Marius Storm-Olsen
2007-08-13 8:51 ` Steffen Prohaska
2007-08-13 14:35 ` Dmitry Kakurin
2007-08-14 8:40 ` [PATCH 1/2] attr.c: refactoring Junio C Hamano
2007-08-14 8:41 ` [PATCH 2/2] attr.c: read .gitattributes from index as well Junio C Hamano
2007-08-13 6:46 ` [PATCH 2/2] checkout: fix attribute handling in checkout all Steffen Prohaska
2007-08-13 16:14 ` Johannes Schindelin
2007-08-13 7:24 ` David Kastrup
2007-08-13 14:55 ` git-update-ref bug? (was: [PATCH 2/2] checkout: fix attribute handling in checkout all) David Kastrup
2007-08-13 20:12 ` [PATCH 2/2] checkout: fix attribute handling in checkout all Junio C Hamano
2007-08-13 1:51 ` Brian Downing [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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070813015115.GI21692@lavos.net \
--to=bdowning@lavos.net \
--cc=dmitry.kakurin@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=prohaska@zib.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.
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).