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

Re: [PATCH] safecrlf: Add flag to convert_to_git() to disable safecrlf check

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 14, 2008, 23:58 UTC
Message-ID
<7vk5mchsct.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<12003528401309-git-send-email-prohaska@zib.de>
Steffen Prohaska <prohaska@zib.de> writes:
Show 6 quoted lines
> 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.

Previous: Steffen ProhaskaNext: Steffen Prohaska
Message 9 of 15 in “safecrlf: Add mechanism to warn about irreversible crlf conversions”
  1. safecrlf: Add mechanism to warn about irreversible crlf conversionsSteffen Prohaska, Jan 13, 2008
  2. Dmitry PotapovJan 13, 2008
  3. Dmitry PotapovJan 13, 2008
  4. Don't display crlf warning twiceDmitry Potapov, Jan 13, 2008
  5. Steffen ProhaskaJan 14, 2008
  6. Dmitry PotapovJan 14, 2008
  7. Steffen ProhaskaJan 14, 2008
  8. safecrlf: Add flag to convert_to_git() to disable safecrlf checkSteffen Prohaska, Jan 14, 2008
  9. Junio C HamanoJan 14, 2008
  10. Steffen ProhaskaJan 15, 2008
  11. Steffen ProhaskaJan 15, 2008
  12. Junio C HamanoJan 15, 2008
  13. Dmitry PotapovJan 15, 2008
  14. Steffen ProhaskaJan 15, 2008
  15. Dmitry PotapovJan 15, 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.