From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id QIJFEVAId2JWPQEAbAwnHQ (envelope-from ) for ; Sun, 08 May 2022 02:01:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id QEVqEFAId2KUWwAAG6o9tA (envelope-from ) for ; Sun, 08 May 2022 02:01:20 +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) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 49670FC48 for ; Sun, 8 May 2022 02:01:19 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 60CF25F717; Sun, 8 May 2022 00:01:16 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 208FE5F700 for ; Sun, 8 May 2022 00:01:13 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 626D55FBD7; Sat, 7 May 2022 20:01:11 -0400 (EDT) Received: (nullmailer pid 4118171 invoked by uid 1000); Sun, 08 May 2022 00:01:09 -0000 From: David Bremner To: Sean Whitton , notmuch@notmuchmail.org Subject: Re: WIP: promote nmbug to user sync tool In-Reply-To: <87tuaacw7q.fsf@athena.silentflame.com> References: <20220423133848.3852688-1-david@tethera.net> <87tuaacw7q.fsf@athena.silentflame.com> Date: Sat, 07 May 2022 21:01:09 -0300 Message-ID: <87o8083nay.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: XY6JCPZOYMBHAH4R6K4IZB674EKQVFN5 X-Message-ID-Hash: XY6JCPZOYMBHAH4R6K4IZB674EKQVFN5 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-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=1651968080; 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=dxgWObVh720ZCS/OlZ1EXJIwixyDW4o3t6gsI4693a0=; b=hiAwEniJ52kcd+8vi6UVLdN1lJA0mAiNkNtnhJ0LBqX2xBDeFpRlpTSUDJ6j39Qy4+wrfh lgsKJHg3aBfrdjCeYd8TRWOJI2oY3Ma86RLgDc54HS/2pSPwgRDOKMLqmUgr/xPYzBFFED 7y3hBxljdO7F0ONcXGtthrXC6CtaDiBoSrD7nH4PdIR2mqPBth8HoR87BPJxldxkanxSrU Vti8ECxYVKqVwkFWlusOH0Qj9bhTVLFKETs8MbY3W2SeLDwGf4j7L+hqQAPPBHfrgUL8fS Bjguugh/llXnU8W7CXfSwlRFXKTcSv8UUzJqYFuktEKE4MLMRi+KpKRfSHmZWA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651968080; a=rsa-sha256; cv=none; b=mlwN4Tblry4eavC8C0Mj3IvsHF2M4OOEj/VOXNJb0LGDWQzNG76/1JxbKRrlawe5P4wgRM B6hEbPKqgusiWP8rSErG7Y2vDVobh9Kcyjc784OHWpDZikT+ze6bTXP8cEC2wtdq6dH9Sk pBXgOsrny+YcnZDc8VG+h8R0tmiue32+z+wIoSnEwEVHdfRwJonjdpVR1/DvHoAqORrsR5 Cs7Iiiof7DVuSedCWoLw2jsW+MSk+LZ0tmcs08AmenmYnHq+J8MXmIwobPeUNklKQnGmaA jjRi8lNGanbqXDhznnjR/UkXwcKSHiFAE6C1TTxSPNWky6kFdADzY5QlwF/c4A== 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.72 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: 49670FC48 X-Spam-Score: -1.72 X-Migadu-Scanner: scn0.migadu.com X-TUID: XZqlRGwxbKog Sean Whitton writes: > [please keep me CCed] > > Hello David, > > On Sat 23 Apr 2022 at 10:38am -03, David Bremner wrote: > > Just looking at my current usage, there are two cases where I've wrapped > nmbug in some additional myrepos scripting. The first is a status > command: > > status = > nmbug-spw status | grep -v "^U\s" || true > # `nmbug status` does not catch committed but unpushed changes > git --no-pager log --branches \ > --not --remotes \ > --simplify-by-decoration --decorate --oneline > > Possibly notmuch-git could learn how to do this? Perhaps. I think I would prefer something a bit more concise like a count of unpushed commits. Do you tend to actually have meaningful commit messages? > Secondly, I've got this auto-commit command: > > autoci = > nmbug-spw status | perl -ne'/^[AD][ad]?\s/ and $i++ > 500 and exit 1' \ > && nmbug-spw commit > [snip] > As for the former thing, I wonder if instead there could be some > mechanism, connected with the new caching, to associate nmbug repos with > the notmuch database, and refuse to operate unless that association > already exists? So, 'nmbug checkout' would mark it as safe to sync back > and forth between the database and that repo no matter the number of > changes. Personally I would be more worried about checkout (e.g. after init) wiping out my notmuch database, since an errant commit can always be reverted. Both cases seem to be covered by your heuristic. Perhaps we could just count the size of the update, and insist on a --force option if it is too large. > > On Sat 23 Apr 2022 at 03:49pm -03, David Bremner wrote: > >> Related, the current script does not understand NOTMUCH_PROFILE. That >> would be a natural way to locate the default git repo. > > It would, but it wouldn't help with configuring a default prefix. > Perhaps an entry in .notmuch-config for that? Currently I use a tiny > wrapper script: > > #!/bin/sh > > NMBGIT="$HOME/lib/nmbug-spw" NMBPREFIX="spw::" nmbug "$@" > > but it would be great to just be able to type 'notmuch git ...'. > For what it's worth, you can already call notmuch git -C $HOME/lib/nmbug-spw -p spw:: ... if that is more convenient. The defaults have already changed in my latest working branch so the default repo is under $XDG_DATA_HOME/notmuch/$NOTMUCH_PROFILE/git, and the default prefix is ''. But re-reading this, I see see we polled two people and got two answers for what a reasonable default prefix is, so a configuration item is definitely needed for prefix. Probably it is also reasonable to have one for repo location.