From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id UPUyGYSptF+PVgAA0tVLHw (envelope-from ) for ; Wed, 18 Nov 2020 04:56:36 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id WOkwFYSptF/IEgAAB5/wlQ (envelope-from ) for ; Wed, 18 Nov 2020 04:56:36 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 78D7694042C for ; Wed, 18 Nov 2020 04:56:35 +0000 (UTC) Received: from localhost ([::1]:57292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfFWD-0008Ld-Q5 for larch@yhetil.org; Tue, 17 Nov 2020 23:56:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfFVs-0008LF-Vj for help-guix@gnu.org; Tue, 17 Nov 2020 23:56:13 -0500 Received: from pb-smtp21.pobox.com ([173.228.157.53]:62537) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfFVk-0002kV-Qy for help-guix@gnu.org; Tue, 17 Nov 2020 23:56:12 -0500 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id B7A6B102F90; Tue, 17 Nov 2020 23:56:00 -0500 (EST) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:in-reply-to:date:message-id:mime-version:content-type :content-transfer-encoding; s=sasl; bh=nYEEJTL8Vq0dsfSc4aTGUgnQD 74=; b=NEMfLMt0kKFOaubTK1B95e0SodcYMGRQx6GKP+1nZzJnQ9tEXTezUYnQ0 Oic/jlhaPvSW69UnQJCr5w3PLqCzX+dTiWokY9P4gtDpbzJCZmTCNKQcCe8tytlc 1GTXTzX5NJXde7NnuABucUfHnnVU8T8w+SNeKYstJ9evNQ4w64= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id A2EC2102F8E; Tue, 17 Nov 2020 23:56:00 -0500 (EST) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:cc:subject:in-reply-to:date:message-id:mime-version:content-type:content-transfer-encoding; s=mesmtp; bh=H6CyORdrzG+qnsJNd7iG0P0wGQICuN80ahhXlWXiCJc=; b=q26KCazSdkr1md6Kw9QV1eCDexLu9VbHEAR53MGCxyYd1fjq5q6bpVSa6R+YugiyzOgoDXORHGVRa4eU1U0zlrQxkwgDpmrmnp75fOWYEJaVMBNirrlPNAOCPLY8Iu2Ma1U9h4bFHiCVALKHeqREj/F3rykMxJuGSBJGziLCFzw= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id E4F4B102F8D; Tue, 17 Nov 2020 23:55:57 -0500 (EST) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: zimoun Subject: Re: Workflow with mu4e + magit for sending patchsets to guix? In-Reply-To: <86wnykni2v.fsf@gmail.com> Date: Tue, 17 Nov 2020 23:55:55 -0500 Message-ID: <87eekr461w.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Pobox-Relay-ID: 58DB987C-295A-11EB-BF3C-D609E328BF65-24757444!pb-smtp21.pobox.com Received-SPF: pass client-ip=173.228.157.53; envelope-from=kyle@kyleam.com; helo=pb-smtp21.pobox.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/17 23:56:01 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix@gnu.org Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=pobox.com header.s=sasl header.b=NEMfLMt0; dkim=fail (headers rsa verify failed) header.d=kyleam.com header.s=mesmtp header.b=q26KCazS; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Spam-Score: 0.99 X-TUID: 3Flk4lZCNgBk zimoun writes: > On Mon, 16 Nov 2020 at 21:36, Kyle Meyer wrote: > >>> 4. !! send-email --to=3Dguix-patches@gnu.org 0000-cover-letter.patch >>> 5. Wait and refresh my inbox >>> 6. !! send-email --to=3D12345@gnu.org 000?-*.patch >> >> Yeah, 4-6 are tricky and debbugs-specific. For other projects, it could >> just be 'send-email *.patch' once sendemail.to is configured to point to >> the list's address. >> >> For 6, using '--no-thread --in-reply-to=3D...' will retain the same >> threading you'd see if you weren't using debbugs (i.e didn't have to do >> the two-step send). [...] > To me, today the main annoyance is the selection of the patches at the > step #6. For example, avoid to resend unrelated patches, as: > > - 000?-*.patch could resend the 0000-cover-letter.patch > - *.patch could resend 0000-cover-letter.patch and 0001-Foo-bar.patch > if I am currently sending v2-0001-Foo-bar.patch > - any previous patchset remaining. Yeah, I agree about that being the most annoying aspect, but I'd say that core problem comes from the need for a two-step send. That's a quirky enough divergence from the standard workflow that I think any solution/helper here is unlikely to be in the scope of Magit. But that doesn't mean I don't think it'd be nice to come up with a helper. > Recent example inside my > guix-artwork checkout:=20 > --8<---------------cut here---------------start------------->8--- > 0000-cover-letter.patch > 0001-website-Add-conference-announcement.patch [...] > 0001-website-Update-manifest.patch > tiny.patch > v2-0001-website-Add-conference-announcement.patch [...] > v4-0001-website-Release-conference-schedule.patch > --8<---------------cut here---------------end--------------->8--- > > That=E2=80=99s why time to time I create an output directory and put the = series > in. But the 0000-cover-letter.patch (or vN-0000-cover-letter.patch) is > still annoying because it blocks the simple *.patch. Nothing simpler > than * could be done, I see you regexp integrist. :-) Yeah, I'd guess a directory per topic and version is pretty common to make selecting the patches simply DIR/* (again, assuming a normal one-step send-email process). > I am thinking loud. One option (some setq) could be added to Magit > format-patch, and do under the hood: > > - create 0000-cover-letter.patch in the root directory > - create folder v1 (default), otherwise v2 =E2=80=A6 vN and put the seri= es > in. > > This would be configurable via Magit variables, say: > > magit-send-email-workflow t > magit-format-patch-directory-prefix =E2=80=9Cv=E2=80=9D As I said, I'm not sold on this being something that fits Magit proper, but I'll help write a helper :) > Then, the sequence, > > W C-m l C-m c > W C-m v2 c > W C-m l C-m v3 c > > would produce the final tree: > > + > +- .git > +- 0000-cover-letter.patch > +- v3-0000-cover-letter.patch > +- v1 > +- 0001-Foo-Bar.patch Here's a command that gets you close to that layout. It adds an additional "/" directory on top of the structure you show above. The name is reads from the caller (with a default completion value of the current branch name). It also depends on the caller having an upstream branch set (which I think is a good thing), but you could rework it to avoid it. --8<---------------cut here---------------start------------->8--- (defun my/magit-patch-create-split-directory (name &optional args files) "Create patches in a split layout. Call `git format-patch ARGS -- FILES`, splitting the cover letter off from the main patches. A standard format-patch calls creates a layout like 0000-cover-letter.patch 0001-commit-1-subj.patch 0002-commit-2-subj.patch ... in the directory specified by `--output-directory=3D' or the current directory. This command expands the structure as NAME |-- 0000-cover-letter.patch `-- vN |-- 0001-commit-1-subj.patch |-- 0002-commit-1-subj.patch where NAME is a name for the series and N is the version specified via `--reroll-count=3D'. The cover letter will have a \"vN-\" prefix after the first version. The motivation for the above layout is to make it easier to send the cover letter to a Debbugs list and, once a bug number is assigned, follow up with the remaining patches: $ git send-email --to=3D$debbugs-list NAME/0000-cover-letter.patch $ # [ wait for mail ] $ git send-email --to=3D$bug-address-from-mail \\ --in-reply-to=3D$cover-letter-message-id --no-thread NAME/vN/*" (interactive (cons (read-string "Series name: " nil nil (magit-get-current-branch)) (let ((args (transient-args 'magit-patch-create))) (list (seq-filter #'stringp args) (cdr (assoc "--" args)))))) (let* ((upstream (or (magit-get-upstream-branch) (user-error "No upstream branch"))) (version (or (seq-some (lambda (arg) (and (string-match "\\`--reroll-count=3D\\(.+\\)" arg) (format "v%s" (match-string 1 arg)))) args) "v1")) (dir (file-name-as-directory (expand-file-name name (or (seq-some (lambda (arg) (and (string-match "\\`--output-directory=3D\\(.+\\)" arg) (expand-file-name (match-string 1 arg)))) args))))) (vdir (concat dir version))) (when (file-exists-p vdir) (user-error "Directory already exists: %s" vdir)) (magit-run-git "format-patch" upstream (concat "--output-directory=3D" vdir) (seq-remove (lambda (arg) (string-match-p "\\`--output-directory=3D" arg)) args) "--" files) (let ((cover (or (car (directory-files vdir t (rx string-start (zero-or-one "v" (one-or-more digit) "-") (one-or-more "0") "-cover-letter.patch"))) (error "No cover letter found")))) (rename-file cover (concat dir (file-name-nondirectory cover)))))) (transient-append-suffix 'magit-patch-create "c" '("s" "Split directory" my/magit-patch-create-split-directory)) --8<---------------cut here---------------end--------------->8---