From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id iMmTGuuF9GYRcwAAe85BDQ:P1 (envelope-from ) for ; Wed, 25 Sep 2024 21:51:39 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id iMmTGuuF9GYRcwAAe85BDQ (envelope-from ) for ; Wed, 25 Sep 2024 23:51:39 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=tethera.net header.s=2024 header.b=GvQnR23V; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727301099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=d55ue8F7g5+hPMFOVfSmRkcMndjdRSRsLNx2kNvQ9mk=; b=bKPK52VdT32uqGGbBpzGhQX7WoJvqatzuzt9i9f2cxRJwMFHCN3r4YUhU9zRPb50gbTF8G yU6q7EhDocLawVPeV7Do7EQaqKk0yAKv0dx8mz3OAyYMOtBEy7a3rYNG9s2Ij57j4BQp8V bDiOGiaZo+kzBXGsBmdpCv1GGWByT9NhRHd46CiYmhhBYcWXxyHavHk8Ee9ss5mzIaT6pH d6QJnVdAaoN2dx/1faC44m2gviyVMcbAKhn6X1fQtmoXLrrsl5o8fEj+y9YEYY8elLWqxe uHvTd/UEFKOzX45LzR4qeFXTY39x0thBs1zEGbFL21lSjVGcvVCKGENQtYtRRw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727301099; a=rsa-sha256; cv=none; b=RIiRaBxaQYoc3YYIR532nlPm2wvxLS+CY1XYAveHBn1y0aYvLeIN64HK2Hte5NennHVAxg JDr6RAhN6veUeLcGsUN4hnb6v7uite/X1++ymqhWJLWErYR5XpNhQbZ3x4UhKr8frWsCiy zHmtOZ8hzW3A2nAwKuLB01pRZnGeRtCi6u2iFlsks8Balo3904uAoI4dZG3tzdhN4w2OA3 stvguoIKefrjbL1DVkdBCqk4Fa+0Bnv+VR+FvjUDaiNg2b9Is2u+jYghWs99tqloT+Gko1 qEu/NAAUZzhTbQtBVB6UxDQDw+VZg7IdGnC9+VK1bj42AsWLO4tWl1M1W8CgPw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=tethera.net header.s=2024 header.b=GvQnR23V; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 147645EEB7 for ; Wed, 25 Sep 2024 23:51:37 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 077CC5F3A4; Wed, 25 Sep 2024 21:51:28 +0000 (UTC) Received: from phubs.tethera.net (phubs.tethera.net [192.99.9.157]) by mail.notmuchmail.org (Postfix) with ESMTPS id 256075E50A for ; Wed, 25 Sep 2024 21:51:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tethera.net; i=@tethera.net; q=dns/txt; s=2024; t=1727301081; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=GBEI+1JkagTeqaaR76fOwnTkwFcmTeqm0cDMYD60wGU=; b=GvQnR23Voh4fxGhW1dIUAX/Oc7ez6awNaTfrVuUfEmXQ6evZCt5WuaZAev3aLvYcE5afw DaodrG5csIA1hmk1vfgwXaqFtid6dNpJf2NGJWEVBHL1tZa1eHgU3KB4M+G6VrLQyZxLX+/ ABYDaUqieODD3cEZcy5nEHwu1avi1d/ET0aArvix8EyA86OxX1f9YJVXu9TDZVTt8jCnoQ3 mHMqGDhE+YvF3a01XPG0PQIjgqFMgAh7UiVR6OvbUAebjSaTzJkfURbWyoWEqk/ZRPgolsV yr/jz6VjmwHbU95JCAUQ/Vo/aaJ9gdyTQzhTG21F+hBUVGwDyHNyRDrIPBWw== Received: from tethera.net (fctnnbsc51w-159-2-211-58.dhcp-dynamic.fibreop.nb.bellaliant.net [159.2.211.58]) by phubs.tethera.net (Postfix) with ESMTPS id DAC8018006E; Wed, 25 Sep 2024 18:51:21 -0300 (ADT) Received: (nullmailer pid 588616 invoked by uid 1000); Wed, 25 Sep 2024 21:51:21 -0000 From: David Bremner To: Brennan Vincent , notmuch@notmuchmail.org Subject: Re: [PATCH v2] Add --emit-message-id flag to notmuch-insert. In-Reply-To: <87msketeua.fsf@taipei.mail-host-address-is-not-set> References: <87plpbtfj2.fsf@taipei.mail-host-address-is-not-set> <87msketeua.fsf@taipei.mail-host-address-is-not-set> Date: Wed, 25 Sep 2024 18:51:21 -0300 Message-ID: <87plorl7vq.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: R7YXN445SHJAVC45MHUJVOQWKNW4VXZX X-Message-ID-Hash: R7YXN445SHJAVC45MHUJVOQWKNW4VXZX X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Country: DE X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.21 X-Spam-Score: -3.21 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Queue-Id: 147645EEB7 X-TUID: fTOyEwi31dmf Brennan Vincent writes: First, thanks for sending a contribution to notmuch. Usually we insist on a bit more verbose (see https://notmuchmail.org/contributing/#index5h2 for details). Here it's probably enough to mention the overall goal of the patch series, that this feature will be used to add a draftify feature, but maybe you have a more general "why" to discuss. > --- > doc/man1/notmuch-insert.rst | 5 +++++ > notmuch-insert.c | 26 +++++++++++++++++++++----- > 2 files changed, 26 insertions(+), 5 deletions(-) > > diff --git a/doc/man1/notmuch-insert.rst b/doc/man1/notmuch-insert.rst > index e05bd0b5..3848b8f6 100644 > --- a/doc/man1/notmuch-insert.rst > +++ b/doc/man1/notmuch-insert.rst > @@ -66,6 +66,11 @@ Supported options for **insert** include > umask. By default, delivered mail is only readable by the current > user. > > +.. option:: --emit-message-id > + > + On successful exit (or with ``--keep``), > + print the message ID of the newly indexed message. > + I'm a bit confused here. If indexing fails with --keep, the printed id will not exist in the database, right? So how is the user supposed to detect that kind of failure? > -add_file (notmuch_database_t *notmuch, const char *path, tag_op_list_t *tag_ops, > +add_file (const void *ctx, notmuch_database_t *notmuch, const char *path, tag_op_list_t *tag_ops, Since notmuch is already a talloc context, you should address the need for a new context somewhere (either a comment or the commit message). > > DONE: > - notmuch_message_destroy (message); > - > if (status) { > if (keep) { > status = NOTMUCH_STATUS_SUCCESS; > @@ -458,6 +457,15 @@ add_file (notmuch_database_t *notmuch, const char *path, tag_op_list_t *tag_ops, > } > } > } > + if (message_id_out) { > + if (!status) { I can't quite explain why I don't mind if (status), but find "if (!status)" for success a bit jarring/confusing, but an explicit test against NOTMUCH_STATUS_SUCCESS would be nicer, IMHO. A more substantial comment is that for new CLI features we need at least one or two tests. Hopefully test/T070-insert.sh gives you enough clues, but feel free to ask for help.