From: Junio C Hamano <gitster@pobox.com>
To: Steffen Prohaska <prohaska@zib.de>
Cc: dpotapov@gmail.com, gitster@pobox.com,
torvalds@linux-foundation.org, git@vger.kernel.org
Subject: Re: [PATCH] safecrlf: Add flag to convert_to_git() to disable safecrlf check
Date: Mon, 14 Jan 2008 15:58:42 -0800 [thread overview]
Message-ID: <7vk5mchsct.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <12003528401309-git-send-email-prohaska@zib.de> (Steffen Prohaska's message of "Tue, 15 Jan 2008 00:20:40 +0100")
Steffen Prohaska <prohaska@zib.de> writes:
> We want to verify if an autocrlf conversion is reversible only if
> the converted data is actually written to the repository. Only
> in this case the file would be modified during the next checkout.
> But convert_to_git() is used for some other purposes.
> This commit adds a flag to convert_to_git() that controls if the
> safecrlf check is enabled...
At first this felt dirty to me as convert_to_git() is not
limited to crlf, but about external vs canonical representation.
The variable name being "checksafe" however makes it much more
palatable. It is clear that it is talking about irreversible
conversion.
When running diff with a work tree file and the index (or a
named tree), we read the work tree file and run convert_to_git()
on it before comparing it with what we have in the object store
(either index or a named tree). When running apply without
touching the index, we also use convert_to_git() on the work
tree file. The patch file is supposed to record the data in
canonical format, I think.
Of course, "git add" on the path will warn or fail with your
patch, but we may somehow want to be warned about the breakage
before "git add" on that path triggers it. Perhaps we can have
a separate "check-work-tree" command that iterates over locally
modified work tree files and runs convert_to_git() with checking
enabled.
next prev parent reply other threads:[~2008-01-14 23:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-13 16:30 [PATCH v3] safecrlf: Add mechanism to warn about irreversible crlf conversions Steffen Prohaska
2008-01-13 22:02 ` Dmitry Potapov
2008-01-13 22:13 ` Dmitry Potapov
2008-01-13 23:46 ` [PATCH] Don't display crlf warning twice Dmitry Potapov
2008-01-14 6:17 ` Steffen Prohaska
2008-01-14 6:40 ` Dmitry Potapov
2008-01-14 6:53 ` Steffen Prohaska
2008-01-14 23:20 ` [PATCH] safecrlf: Add flag to convert_to_git() to disable safecrlf check Steffen Prohaska
2008-01-14 23:58 ` Junio C Hamano [this message]
2008-01-15 20:52 ` Steffen Prohaska
2008-01-15 21:41 ` Steffen Prohaska
2008-01-15 23:23 ` Junio C Hamano
2008-01-15 10:26 ` Dmitry Potapov
2008-01-15 20:39 ` Steffen Prohaska
2008-01-15 23:03 ` Dmitry Potapov
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=7vk5mchsct.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=dpotapov@gmail.com \
--cc=git@vger.kernel.org \
--cc=prohaska@zib.de \
--cc=torvalds@linux-foundation.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).