Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 6A297431FB6 for ; Sat, 21 Apr 2012 11:10:18 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gv3YqfzTMyUY for ; Sat, 21 Apr 2012 11:10:18 -0700 (PDT) Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id A14A8431FAE for ; Sat, 21 Apr 2012 11:10:17 -0700 (PDT) Received: by lahc1 with SMTP id c1so8318000lah.26 for ; Sat, 21 Apr 2012 11:10:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:x-originating-ip:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=P7eeEiRfvJVApTuhu6BVTfFJo31L5Ph91NEeiWBBtZQ=; b=n4fAUCWQPaCy7uzQbNIpNfww7wdPHWzQ6ZbPylXOLcmbB2wI/DoocxxNG95f/hTogM 1gQqy66gwbz4wTq61z+vdKsJBaMm3Rc8XtH59lCFddl0rS+RAn8mQ+P9BVgJLWQ7g6zR 9mjkqEL6my9ZqSgAdCjrRaIhmiuqUwpv7ps3CnMOQJ5G5u005ADMhIsXbwWTjOdfxKZr 6VhZvKJXuAQFs3yM0WcYCdaiy2niG09PEE3k0Zy0UIfR842tz8yA5REpfRmIAEF4n1pA fw1bzsCKm+HV7r2t2N7xYvewrkLi8D/49g6EjzWs0rFc9q6tY3An/IsyMnUpND8KPoyH MoDw== MIME-Version: 1.0 Received: by 10.152.148.234 with SMTP id tv10mr824143lab.41.1335031814464; Sat, 21 Apr 2012 11:10:14 -0700 (PDT) Sender: awg@xvx.ca Received: by 10.112.23.39 with HTTP; Sat, 21 Apr 2012 11:10:14 -0700 (PDT) X-Originating-IP: [96.52.216.56] In-Reply-To: <1334999750-21811-2-git-send-email-markwalters1009@gmail.com> References: <1334999750-21811-1-git-send-email-markwalters1009@gmail.com> <1334999750-21811-2-git-send-email-markwalters1009@gmail.com> Date: Sat, 21 Apr 2012 12:10:14 -0600 X-Google-Sender-Auth: 4khZu3ep2u4JL-49XDPYmCiFwZI Message-ID: Subject: Re: [PATCH v3 1/2] cli: make --entire-thread=false work for format=json. From: Adam Wolfe Gordon To: Mark Walters Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkjgyOOJ3hpvrO5qWPE9ayV6kZNwyoyB76Nqb2evgB+VxD29bratKrgW7RGBKX/MF8JO3we Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2012 18:10:18 -0000 On Sat, Apr 21, 2012 at 03:15, Mark Walters wrote: > The --entire-thread option in notmuch-show.c defaults to true when > format=json. Previously there was no way to turn this off. This patch > makes it respect --entire-thread=false. > > The one subtlety is that we initialise a notmuch_bool_t to -1 to > indicate that the option parsing has not set it. This allows the code > to distinguish between the option being omitted from the command line, > and the option being set to false on the command line. > > Finally, all formats except Json can output empty messages for non > entire-thread, but in Json format we need to output {} to keep the > other elements (e.g. the replies to this message) in the correct > place. LGTM. You can probably remove the relevant item from devel/TODO as well! -- Adam