From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uzjMHpEBZGKsGQEAbAwnHQ (envelope-from ) for ; Sat, 23 Apr 2022 15:39:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 6NaRHZEBZGLFUAEA9RJhRA (envelope-from ) for ; Sat, 23 Apr 2022 15:39:29 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4D4C414CFF for ; Sat, 23 Apr 2022 15:39:29 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 04D715F76A; Sat, 23 Apr 2022 13:39:07 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 17B9C5F762 for ; Sat, 23 Apr 2022 13:39:04 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 4C17E5FC0D; Sat, 23 Apr 2022 09:39:03 -0400 (EDT) Received: (nullmailer pid 3856575 invoked by uid 1000); Sat, 23 Apr 2022 13:38:57 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 12/16] CLI/git: rename private index file. Date: Sat, 23 Apr 2022 10:38:44 -0300 Message-Id: <20220423133848.3852688-13-david@tethera.net> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220423133848.3852688-1-david@tethera.net> References: <20220423133848.3852688-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: YQPXONS7BFJ6M5CJ7JBVL4JIBONFO4GW X-Message-ID-Hash: YQPXONS7BFJ6M5CJ7JBVL4JIBONFO4GW X-MailFrom: bremner@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-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1650721169; 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; bh=Z1Gy+acVCP1XaRG1u+PIqleYn+ZigMEZe2ABdceTdAQ=; b=DQPU8/QK0Mks9YXp/JHwgadqIbwWVo0ysuIQ6dVqIHdwmJDsbvXAKz4a4fUfwnoEJFOpcO ngaZPieZOs8JVWkI8U16FsNmjnawpSuAVpbHinqnbtmQbokZ61mZLQhjvz52ChccDXeZbE CT1C1QofGtofuAn02CUSQ3EgogFlVzD4TcV6wZXv+RRltL+SUJrZ3qfvAvENp4gpd04ucP uk7mfALOG+At97F63wVj5CgBiGcMDq683FkQJmqj+cVjIfqqfP5kguJTumPWHu3pLpom2+ 5I3JGyee1tJ7MxTW4M6ruyXm5nOJYtj1NEAQbsXyWH25XSZy0LDCXV+1n8cHZA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650721169; a=rsa-sha256; cv=none; b=n+oNToiRfJwyiVU2wX17qh/2jyrtoU9FjUpaClDYDh4edMtgk/5Qqdo0GMp9JR132mOzkc w1tBUPboVHR0n13OzdrrjnNRfoS9RbYzCQ1YCd9lEzUuwnGf1wQusFWo+aCtEG9RsejECO ILlWVqEi8DfNq6bLOh8576QHMKFTS1QnbBaQNkUjXrTV3fm3Dye25tUVwQZ4WHsl1v8mRx yQ3J3xU2EMT+uYaDwRl1OK+qr6puOxukU0jj/MhX3bQ7fmAUodQHLR4R0597gOkf8LSSB4 /moShTOaedzX4RgWOL1wyzMGjfYOa2Q/lkjSl371HvvFM3EAeP+dRZJVqGU+GA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.01 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 4D4C414CFF X-Spam-Score: -1.01 X-Migadu-Scanner: scn1.migadu.com X-TUID: Nkv/yT6s+zFs All files created by notmuch-git should be in a private directory to avoid collisions. --- notmuch-git.in | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/notmuch-git.in b/notmuch-git.in index 0d9f50a1..b69d57e7 100755 --- a/notmuch-git.in +++ b/notmuch-git.in @@ -638,8 +638,9 @@ def get_status(): @timed def _index_tags(): - "Write notmuch tags to the nmbug.index." - path = _os.path.join(NMBGIT, 'nmbug.index') + "Write notmuch tags to private git index." + ensure_private_directory(NMBGIT) + path = _os.path.join(NMBGIT, 'notmuch','index') prefix = '+{0}'.format(_ENCODED_TAG_PREFIX) _git( args=['read-tree', '--empty'], @@ -747,6 +748,12 @@ def _help(parser, command=None): parser.parse_args(['--help']) +def ensure_private_directory(repo): + try: + _os.makedirs(_os.path.join(repo, 'notmuch')) + except FileExistsError: + pass + if __name__ == '__main__': import argparse -- 2.35.2