git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v6] safecrlf: Add mechanism to warn about irreversible crlf conversions

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 3, 2008, 22:53 UTC
Message-ID
<7vejbtsld4.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<4C024D67-9FA5-451D-BB91-CE9464C6F50D@zib.de>
Steffen Prohaska <prohaska@zib.de> writes:
Show 11 quoted lines
>> The whole point of git-apply is to apply the patch.  If you say
>> --whitespace=fix and some contents (say one of the testsuite
>> files in our t/ directory) needed to keep trailing newline, you
>> obviously are left with a broken result, and you would recover
>> by checking it out from index or HEAD and reapply.  Why
>> shouldn't the same principle hold here?
>
> You are right.  All files should be committed before running
> git apply and therefore the original files can be recovered by
> git checkout.  Hmm ... so apply should either just warn or be
> completely quiet as git blame is?  I think it should warn.
I agree that warning is needed if the setting says "warn".

Of course, it could become part of an irreversible action if you did this:

	$ git commit ;# or whatever.  Now there is no local mods
        $ git apply <patch-1
	$ edit ;# to fix things up
        $ git apply <patch-2
and if you get the warning from patch-2.

But the safecrlf warning is primarily about a misdetection of binaryness, so I do not think this sequence is not something we would even want to worry about.

Previous: Johannes Schindelin
Message 17 of 17 in “safecrlf: Add mechanism to warn about irreversible crlf conversions”
  1. safecrlf: Add mechanism to warn about irreversible crlf conversionsSteffen Prohaska, Feb 2, 2008
  2. Junio C HamanoFeb 3, 2008
  3. Steffen ProhaskaFeb 3, 2008
  4. safecrlf: Add mechanism to warn about irreversible crlf conversionsSteffen Prohaska, Feb 3, 2008
  5. Johannes SchindelinFeb 3, 2008
  6. Steffen ProhaskaFeb 4, 2008
  7. [v8] safecrlf: Add mechanism to warn about irreversible crlf conversionsSteffen Prohaska, Feb 4, 2008
  8. Johannes SchindelinFeb 4, 2008
  9. Steffen ProhaskaFeb 4, 2008
  10. Johannes SchindelinFeb 4, 2008
  11. Junio C HamanoFeb 6, 2008
  12. Steffen ProhaskaFeb 6, 2008
  13. [v9] safecrlf: Add mechanism to warn about irreversible crlf conversionsSteffen Prohaska, Feb 6, 2008
  14. Junio C HamanoFeb 6, 2008
  15. Steffen ProhaskaFeb 6, 2008
  16. Johannes SchindelinFeb 4, 2008
  17. Junio C HamanoFeb 3, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.