git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx.manpages@gmail.com>
To: Git Mailing List <git@vger.kernel.org>,
	Alejandro Colomar <alx@nginx.com>
Subject: Re: Dubious diff using --diff-algorithm=histogram
Date: Fri, 28 Apr 2023 23:36:11 +0200	[thread overview]
Message-ID: <cb3a07d6-8441-b7fb-4994-3b22e3b974de@gmail.com> (raw)
In-Reply-To: <a0b6d751-25fd-a132-f8a5-9844e5d9b8a6@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1018 bytes --]

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      parent reply	other threads:[~2023-04-28 21:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-04 19:51 Dubious diff using --diff-algorithm=histogram Alejandro Colomar
2023-04-04 19:53 ` Alejandro Colomar
2023-04-28 21:36 ` Alejandro Colomar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cb3a07d6-8441-b7fb-4994-3b22e3b974de@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=alx@nginx.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).