All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: miwilliams@google.com
Cc: git@vger.kernel.org
Subject: Re: none
Date: Mon, 11 Apr 2016 21:18:00 +0200	[thread overview]
Message-ID: <vpq37qsosyf.fsf@anie.imag.fr> (raw)
In-Reply-To: <001a11492f107354a305303a369a@google.com> (miwilliams@google.com's message of "Mon, 11 Apr 2016 19:04:23 +0000")

miwilliams@google.com writes:

> From 7201fe08ede76e502211a781250c9a0b702a78b2 Mon Sep 17 00:00:00 2001
> From: Mike Williams <miwilliams@google.com>
> Date: Mon, 11 Apr 2016 14:18:39 -0400
> Subject: [PATCH 1/1] wt-status: Remove '!!' from
> wt_status_collect_changed_cb
>
> The wt_status_collect_changed_cb function uses an extraneous double
> negation (!!)
> when determining whether or not a submodule has new commits.

It's not just a double negation, it's a way to ensure that the value is
0 or 1 (it's a relatively common idiom in C at least in Git's codebase).

new_submodule_commits is a 1-bit bitfield, and you don't want to assign
anything other than 1 or 0 (or you'll get modulo 2^n semantics, with
n==1).

So the old code is correct and your patch would introduce a bug.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  parent reply	other threads:[~2016-04-11 19:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11 19:04 (unknown), miwilliams
2016-04-11 19:13 ` your mail Jeff King
2016-04-11 19:18 ` Matthieu Moy [this message]
2016-04-12  4:33 ` Stefan Beller
  -- strict thread matches above, loose matches on Subject: below --
2023-10-16 18:43 Dorcas Litunya
2023-10-17 20:21 ` none Junio C Hamano
2019-11-20  3:49 Han-Wen Nienhuys
2019-11-20  4:52 ` none Junio C Hamano
2019-11-20  5:00   ` none Han-Wen Nienhuys
2019-03-03 13:20 [PATCH 1/3] test functions: Add new function `test_file_not_empty` Junio C Hamano
2019-03-03 13:29 ` Rohit Ashiwal
2019-03-03 13:33   ` none Junio C Hamano
2018-10-05  6:20 [PATCH] doc: fix a typo and clarify a sentence Junio C Hamano
2018-10-10 15:20 ` Mihir Mehta
2018-10-10 22:19   ` none Junio C Hamano
2014-08-29 14:22 No subject Ravi Raj
2014-08-29 14:47 ` Valdis.Kletnieks at vt.edu
2014-08-29 14:58   ` Ravi Raj
2014-08-29 15:32     ` No subject Valdis.Kletnieks at vt.edu
2014-08-29 15:53       ` none Bjørn Mork
2009-07-01  3:37 Larry Finger
2009-07-01  8:32 ` none Kalle Valo
2009-07-01  3:36 Larry Finger
2009-07-01  8:31 ` none Kalle Valo
2005-05-19  6:23 none Gerald Turner
2003-08-28 19:08 none kartikey bhatt
2003-06-30 16:11 None 
2003-06-19 11:45 None Владимир Сорокин
2002-07-17 14:19 None Bloch, Jack
2002-07-17 14:15 None irfan_hamid
2000-11-16 10:03 Sergey Volkoff
2000-11-16 14:46 ` none Chmouel Boudjnah

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=vpq37qsosyf.fsf@anie.imag.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=miwilliams@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.