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

Re: [PATCH 1/5] convert_to_git(): checksafe becomes an integer

From
Lars Schneider <larsxschneider@gmail.com>
Date
Dec 31, 2017, 12:23 UTC
Message-ID
<96B6CD4C-0A0C-47F5-922D-B8BAFB832FD1@gmail.com>
In-Reply-To
<20171231080552.22258-1-tboegi@web.de>
Show 11 quoted lines
> On 31 Dec 2017, at 09:05, tboegi@web.de wrote:
> 
> From: Torsten Bögershausen <tboegi@web.de>
> 
> When calling convert_to_git(), the checksafe parameter has been used to
> check if commit would give a non-roundtrip conversion of EOL.
> 
> When checksafe was introduced, 3 values had been in use:
> SAFE_CRLF_FALSE: no warning
> SAFE_CRLF_FAIL:  reject the commit if EOL do not roundtrip
> SAFE_CRLF_WARN:  warn the user if EOL do not roundtrip

In general, I really like the direction as this simplifies my patch later on in 5/5. However, I see a few problems:

(1) The prefix "SAFE_CRLF" confuses me because the main theme
    is EOL and CRLF just happens to be a EOL type.
    What do you think about something like this:
    CONVERT_ERROR_IGNORE     0
    CONVERT_EOL_ERROR_DIE    (1<<0)
    CONVERT_EOL_ERROR_WARN   (1<<1)
    CONVERT_EOL_TO_LF        (1<<2)
    CONVERT_EOL_KEEP_CRLF    (1<<3)
    CONVERT_ENCODE_ERROR_DIE (1<<4)
(2) We mix error reporting switches (FALSE/FAIL/WARN) with
    switches that change the content (RENORMALIZE/KEEP_CRLF).
    Plus, these the switches should be mutually exclusive
    (e.g. we don't want to enable the FAIL and WARN bit at
    the same time).
(3) We kind of replicate some flags defined in cache.h:
    #define HASH_WRITE_OBJECT 1
    #define HASH_RENORMALIZE  4
- Lars
Previous: tboegi@web.deNext: tboegi@web.de
Message 16 of 26 in “convert: add support for different encodings”
  1. 0/5 convert: add support for different encodingslars.schneider@autodesk.com, Dec 29, 2017
  2. 1/5 strbuf: add xstrdup_toupper()lars.schneider@autodesk.com, Dec 29, 2017
  3. Torsten BögershausenDec 29, 2017
  4. Lars SchneiderDec 29, 2017
  5. 2/5 utf8: add function to detect prohibited UTF-16/32 BOMlars.schneider@autodesk.com, Dec 29, 2017
  6. 5/5 convert: add tracing for checkout-encodinglars.schneider@autodesk.com, Dec 29, 2017
  7. 4/5 convert: add support for 'checkout-encoding' attributelars.schneider@autodesk.com, Dec 29, 2017
  8. Torsten BögershausenDec 29, 2017
  9. Lars SchneiderDec 30, 2017
  10. 3/5 utf8: add function to detect a missing UTF-16/32 BOMlars.schneider@autodesk.com, Dec 29, 2017
  11. 0/5 V2B: simplify convert.c/htboegi@web.de, Dec 31, 2017
  12. 5/5 convert: add support for 'checkout-encoding' attributetboegi@web.de, Dec 31, 2017
  13. Johannes SchindelinJan 5, 2018
  14. 3/5 utf8: add function to detect prohibited UTF-16/32 BOMtboegi@web.de, Dec 31, 2017
  15. 1/5 convert_to_git(): checksafe becomes an integertboegi@web.de, Dec 31, 2017
  16. Lars SchneiderDec 31, 2017
  17. 1/1 convert_to_git(): checksafe becomes int conv_flagstboegi@web.de, Jan 1, 2018
  18. Lars SchneiderJan 2, 2018
  19. Torsten BögershausenJan 3, 2018
  20. Lars SchneiderJan 3, 2018
  21. Lars SchneiderJan 5, 2018
  22. Torsten BögershausenJan 5, 2018
  23. Junio C HamanoJan 5, 2018
  24. Lars SchneiderJan 6, 2018
  25. 2/5 strbuf: add xstrdup_toupper()tboegi@web.de, Dec 31, 2017
  26. 4/5 utf8: add function to detect a missing UTF-16/32 BOMtboegi@web.de, Dec 31, 2017

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.