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

Re: [PATCH] crlf: Add test showing double warning on commit

From
Torsten Bögershausen <tboegi@web.de>
Date
May 14, 2016, 16:20 UTC
Message-ID
<baea5604-e786-5773-aa68-f311efb23752@web.de>
In-Reply-To
<20160514111755.GG2345@dinwoodie.org>
On 14.05.16 13:17, Adam Dinwoodie wrote:
> Add failing test case showing CRLF -> LF rewrite warnings being printed
> multiple times when running "git commit".
>
The problem seems to come from this line:
index 5473493..59d4106 100644
--- a/diffcore-break.c
+++ b/diffcore-break.c
@@ -61,9 +61,18 @@ static int should_break(struct diff_filespec *src,
            !hashcmp(src->sha1, dst->sha1))
                return 0; /* they are the same */
 
+       fprintf(stderr, "%s:%d src-path=%s dst-path=%s\n",
+               __FILE__, __LINE__, src->path, dst->path);
+#if 0
        if (diff_populate_filespec(src, 0) || diff_populate_filespec(dst, 0))
                return 0; /* error but caught downstream */
+#else
 
+       if (diff_populate_filespec(src, 0))
+               return 0; /* error but caught downstream */
+       if (strcmp(src->path, dst->path) && diff_populate_filespec(dst, 0))
+               return 0; /* error but caught downstream */
+#endif
        max_size = ((src->size > dst->size) ? src->size : dst->size);

Do we need to run diff_populate_filespec() twice when src==dst ?
If yes, we may need to introduce a flag besides
#define CHECK_SIZE_ONLY 1
#define CHECK_BINARY    2
to suppress the conversion warning ??

If no, the fix from above should do ?
Previous: Adam DinwoodieNext: Junio C Hamano
Message 2 of 6 in “crlf: Add test showing double warning on commit”
  1. crlf: Add test showing double warning on commitAdam Dinwoodie, May 14, 2016
  2. Torsten BögershausenMay 14, 2016
  3. Junio C HamanoMay 14, 2016
  4. Torsten BögershausenMay 15, 2016
  5. Junio C HamanoMay 15, 2016
  6. Torsten BögershausenMay 15, 2016

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.