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

Re: Dubious diff using --diff-algorithm=histogram

From
ACAlejandro Colomar <alx.manpages@gmail.com>
Date
Apr 28, 2023, 21:36 UTC
Message-ID
<cb3a07d6-8441-b7fb-4994-3b22e3b974de@gmail.com>
In-Reply-To
<a0b6d751-25fd-a132-f8a5-9844e5d9b8a6@gmail.com>
Here's another example of a dubious diff using histogram:
@@ -50,8 +65,11 @@ .SH Examples
     nxt_unit_ctx_t   *ctx;
     nxt_unit_init_t  init;
 
-    bzero(&init, sizeof(nxt_unit_init_t));
+    if (argc == 3 && strcmp(argv[1], "-t") == 0) {
+        nthreads = atoi(argv[2]);
+    }
 
+    bzero(&init, sizeof(nxt_unit_init_t));
     init.callbacks.request_handler = &request_handler;
     init.callbacks.ready_handler = &ready_handler;
 


That call to bzero(3) is the only one in the entire file.
patience shows this instead:


@@ -50,8 +65,11 @@ .SH Examples
     nxt_unit_ctx_t   *ctx;
     nxt_unit_init_t  init;
 
+    if (argc == 3 && strcmp(argv[1], "-t") == 0) {
+        nthreads = atoi(argv[2]);
+    }
+
     bzero(&init, sizeof(nxt_unit_init_t));
-
     init.callbacks.request_handler = &request_handler;
     init.callbacks.ready_handler = &ready_handler;
 
-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
Previous: Alejandro Colomar
Message 3 of 3 in “Dubious diff using --diff-algorithm=histogram”
  1. Alejandro ColomarApr 4, 2023
  2. Alejandro ColomarApr 4, 2023
  3. Alejandro ColomarApr 28, 2023

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.