From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:863f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id GEVVFmr4qmDxDwAAsNZ9tg (envelope-from ); Mon, 24 May 2021 00:50:50 +0000 Received: from out1.migadu.com ([2001:41d0:2:863f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id IeheAmb4qmBdNgAAbx9fmQ (envelope-from ); Mon, 24 May 2021 00:50:46 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1621817445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=zNvDWp/J/OcFr6FW7QTDDi8knHIXxlFPfPdWQvTW9ds=; b=rai60mPwnKqOlqyWbGF0jg8GYMIUgh6W3ytuKKSQJuHkOlGZs/NFOSuFEUU3H1xXxcgM5Z +pISvgIVHrAE9QlI3itNi1BZPx9+wNCs4kMPMjTOupwGnTPo6yGZzIJPAdHKZJAM77oNwc KJObhRhSRKNADd3LCQtpaUr5sNFeRdmYmTJaIGJsivtWOzgLKb5U3B01KTryQ1iiMfwZ+l XLjjSwWaVLo8NAl0Nq5l5EXqxgY4cbXhoZxm8NuYNxDQ5WvbHnUEywYvu5WEpJJBLpow0s YzOsPzb5omAJbJt+ks1hPglPgzoLIW82RMUW7WICku8AP3l/LnUJQ8wVXKUlcA== From: Kyle Meyer To: piem@inbox.kyleam.com Subject: [PATCH] b4: Better describe how piem-b4-am-ready-from-mid gets the thread Date: Sun, 23 May 2021 20:50:40 -0400 Message-Id: <20210524005040.12668-1-kyle@kyleam.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyle@kyleam.com X-TUID: Y5FL3aURCda3 piem-b4-am-ready-from-mid's docstring doesn't mention that it tries to download the thread from a piem-inboxes URL before falling back to letting b4 handle the download. The manual's description is better, though it makes it sound like the b4 fallback depends on not finding a URL in piem-inboxes rather than the download being unsuccessful for whatever reason. Reword the docstring and manual text to hopefully make things clearer. --- Documentation/piem.texi | 10 +++++----- piem-b4.el | 13 +++++++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Documentation/piem.texi b/Documentation/piem.texi index ca6a97b..f4bbabc 100644 --- a/Documentation/piem.texi +++ b/Documentation/piem.texi @@ -341,11 +341,11 @@ Using b4 to apply patches To generate the input thread, first any functions in @code{piem-mid-to-thread-functions} are tried. This allows for a thread to be retrieved from a local store (e.g., the Notmuch database). If -that fails, the thread is downloaded from the public-inbox URL -associated with the current buffer. Finally, if an inbox's entry in -@code{piem-inboxes} doesn't specify a URL, @code{b4 am} is called -without a local mbox, letting it download the thread according to its -own configuration. +that fails, try to download the thread from the @code{piem-inboxes} URL +associated with the current buffer, provided the current buffer's +message ID matches the one @code{piem-b4-am-from-mid} was called with. +As a last resort, call @code{b4 am} without a local mbox to let it +download the thread according to its own configuration. @item i @itemx M-x piem-b4-am-ready-from-mid diff --git a/piem-b4.el b/piem-b4.el index e76953e..ddb18d5 100644 --- a/piem-b4.el +++ b/piem-b4.el @@ -131,10 +131,15 @@ (defun piem-b4-am-ready-from-mid (mid &optional args) (defun piem-b4-am-from-mid (mid &optional args toggle-worktree) "Get the thread for MID, extract an am-ready mbox, and apply it. -Try to get a thread for the Message-Id MID with -`piem-mid-to-thread-functions', falling back to letting b4 -download it. After calling `b4 am' with ARGS to prepare an -am-ready mbox, feed the result to `git am'. +Try to generate a thread for the Message-Id MID with +`piem-mid-to-thread-functions'. If that fails, try to download +the thread from the `piem-inboxes' URL associated with the +current buffer, provided that the current buffer's message ID +matches MID. And if that doesn't work, let `b4 am' download the +thread according to its own configuration. + +After calling `b4 am' with ARGS to prepare an am-ready mbox, feed +the result to `git am'. When prefix argument TOGGLE-WORKTREE is non-nil, invert the meaning of `piem-am-create-worktree'. With the default value, base-commit: 3cf9a8213ff78b9226dba0ad0c045c7de41f3c96 -- 2.31.1