From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#35362: 26.2; [debbugs.el] Automate commit -> debbugs flow (posting patches, closing bugs after pushing) Date: Mon, 22 Apr 2019 15:42:31 -0400 Message-ID: <87d0ldsu6w.fsf@gmail.com> References: <874l6rtnjo.fsf@gmail.com> <871s1vtm9h.fsf@gmail.com> <87wojns7ia.fsf@gmail.com> <875zr7cepw.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="242953"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: 35362@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 22 21:43:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIeqP-00114G-Gs for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Apr 2019 21:43:13 +0200 Original-Received: from localhost ([127.0.0.1]:43397 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIeqO-0002YG-Ea for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Apr 2019 15:43:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIeqG-0002Xf-EL for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2019 15:43:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIeqE-0003ic-Uh for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2019 15:43:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38098) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIeqE-0003iT-Oa for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2019 15:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hIeqE-0004FV-IA for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2019 15:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Apr 2019 19:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35362 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35362-submit@debbugs.gnu.org id=B35362.155596216316308 (code B ref 35362); Mon, 22 Apr 2019 19:43:02 +0000 Original-Received: (at 35362) by debbugs.gnu.org; 22 Apr 2019 19:42:43 +0000 Original-Received: from localhost ([127.0.0.1]:51642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIepu-0004Ex-45 for submit@debbugs.gnu.org; Mon, 22 Apr 2019 15:42:43 -0400 Original-Received: from mail-qk1-f196.google.com ([209.85.222.196]:43200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIeps-0004Ek-7f for 35362@debbugs.gnu.org; Mon, 22 Apr 2019 15:42:40 -0400 Original-Received: by mail-qk1-f196.google.com with SMTP id p19so4796482qkm.10 for <35362@debbugs.gnu.org>; Mon, 22 Apr 2019 12:42:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=NxDAqHAHwUelDNZP6jfQPkm7JbD9C59ADEiX5Anj6h4=; b=kXTIcnYN0CF/9rhYG8EIALe5pInHEsO8YRq1HrXDILTYhPF05vlv6ymeCWClzrdVHx XfUUF4FNHD8VPYG5yKWWS3HCwthL2a8ZNkBI7DlVlxKjZ10SfrHqiHeKpanLxv9B5SYC VgQV0oPJvYRUrdnbIWol2MmW4ghcXGCK0Ql+Vr8L4Y+TxgiW+9g2qLjxQ5oHXvx5Pmsw om0DclmsBdsVNfmrADt/wGETT76i4jiJ6tZEHPdOUVCUo/Cw4Nldy5FSXGg4DQYLA95U 70XvzlQJD56MyFPA+o0bPUwt0m/At2fmSno+27K5G8dn/LrQ6dcyLCZEa9l2IjwaHHgb nZKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=NxDAqHAHwUelDNZP6jfQPkm7JbD9C59ADEiX5Anj6h4=; b=mKdFi1m/gdUF+jg/P5GrCK9KedGymWRe6HkF0F1hf0xIXvlix/brZG3n8yCBWOqSbn E0zGyTPmZJexwFU6V3JOtaN2gi9TyNPM5fIC9VjGK4eSRKRl6/vWvVJ3nY5RO6rwZ4fF YFGqFkch0fFWCdjWP+afVydMaZGQR8iIKYkNS0Ne8gWuAoK4w5kumJZetHm6EDiq7W3S MLJEjArn3QTjsBFrG0fhJV8734BEmZf/FupxOwJ29TfoRdnoLr4gwc2xZ974ZofQM9uG +W3IYgmoGcltNdwTVx+UlRGCMUj/4Q8ItcX1/frpm5MPuAjFFLncA3ed+HWOUozaV1aL b2Ag== X-Gm-Message-State: APjAAAXqLrm4T6mi+OZ7voSoCa1BVwqzItRmZrImTZ/YcdbohuMqTwP6 feObAOF2481Dr3gkmCMg5nTz6V3w X-Google-Smtp-Source: APXvYqytRruTFcv640o9gQ/MVUzyI41WQpeAwnNzmTOI2MbzCYOUl613qunNY94ou4v0KooB6JX3Lg== X-Received: by 2002:a05:620a:1253:: with SMTP id a19mr16152279qkl.148.1555962154351; Mon, 22 Apr 2019 12:42:34 -0700 (PDT) Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id d21sm6579896qkl.58.2019.04.22.12.42.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Apr 2019 12:42:33 -0700 (PDT) In-Reply-To: <875zr7cepw.fsf@gmx.de> (Michael Albinus's message of "Sun, 21 Apr 2019 21:58:51 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158073 Archived-At: Michael Albinus writes: > All your defcustoms miss a :version tag. I guess, "27.1" is proper. Oh, hmm. Shouldn't the version correspond to the debbugs.el package version, since it's not tied to the Emacs version as such? >> ;; Use Gnus. >> (gnus-read-ephemeral-emacs-bug-group >> (cons id (if (listp merged) merged (list merged))) >> + This doesn't work, gives wrong-type-argument listp when quitting. > > Comment chars are missing. Leftover from editing? Sorry, this hunk was supposed to be dropped completely. >> +(defun debbugs-gnus-jump-to-bug (bugid) >> + "Display buffer associated with BUGID with `pop-to-buffer'. >> +Use `gnus-read-ephemeral-emacs-bug-group' instead if there is no such buffer." > > debbugs-gnu.el supports both gnus and rmail. Do we miss something for > rmail then? > > (I'm not an rmail user, but Eli is.) Possibly yes, I haven't used rmail so I'm not sure how to test that out. >> +(defun debbugs-gnu--git-insert (&rest args) >> + "Insert output of running git with ARGS. >> +Throws error if git returns non-zero. Uses `debbugs-gnu-git-program'." >> + (unless (eql 0 (apply #'process-file >> + debbugs-gnu-git-program nil '(t t) nil >> + args)) >> + (error "git %s failed: %s" (car args) (buffer-string)))) > > Why not `vc-git--call'? I thought relying on a function marked as internal would not be a good idea for an ELPA package which should potentially work across multiple versions of Emacs. Otherwise vc-git--call should work fine too. >> + (debbugs-gnu--git-insert "remote" "-v") > >> + (debbugs-gnu--git-insert >> + ;; %H: commit hash. >> + "log" "-1" "--format=%H" commit-range) > >> + (apply >> + #'debbugs-gnu--git-insert >> + "branch" "--remote" "--contains" last-commit >> + (mapcar (lambda (glob) (concat remote glob)) >> + ref-globs)) > >> + (debbugs-gnu--git-insert >> + "show" "--no-patch" >> + (concat "--format=" debbugs-gnu-commit-description-format >> + "\n" (cdr (assq 'commit-url remote-info)) "\n") >> + commit-range) > > >> + (apply #'debbugs-gnu--git-insert >> + "format-patch" (concat "--output-directory=" dir) >> + (append format-patch-args >> + (list commit-range)))) > >> + (debbugs-gnu--git-insert >> + ;; %B: raw body (unwrapped subject and body). >> + "show" "--no-patch" "--format=%B" commit-range) > > Aren't there respective vc-git functions we could reuse? No, I don't see any. >> +@node Posting Patches >> +@section Posting Patches to Debbugs from the Emacs Repository >> + >> +Once you have committed a patch fixing a bug you usually want to post >> +it to the bug thread for review and testing. And when the patch is >> +deemed satisfactory and pushed to the official GNU Emacs repository, >> +the bug should be marked closed. > > Currently, you are supporting both Emacs and ELPA repositories, aren't > you? Please sday so. Yes. >> +@findex debbugs-gnu-pick-commits >> +The command @code{debbugs-gnu-pick-commits} helps automate both these [...] > Reading this doesn't give me a clear picture what happens. Could you add > an example? > > Also, pls describe at least `debbugs-gnu-git-remote-info-alist'. Other > projects but Emacs might profit from. Okay, I've expanded the manual section (inlined below) maybe it gives you a more clear picture (or maybe a less clear one :/). @node Posting Patches @section Posting Patches to Debbugs from the Emacs Repository Once you have committed a patch fixing a bug you usually want to post it to the bug thread for review and testing. And when the patch is deemed satisfactory and pushed to the official repository, the bug should be marked closed. @findex debbugs-gnu-pick-commits The command @code{debbugs-gnu-pick-commits} helps automate both these processes: it queries for a commit (or commit range), and a bug number (defaulting to the bug number mentioned in the commit message). It then jumps you to a buffer associated with the bug. When you reply to a message in the bug thread, you are asked whether to post the commits as patches (optionally tagging the bug with @code{"patch"}), or announce that the bug has been fixed by the selected commits (optionally closing the bug and marking as closed in the Emacs version corresponding to the patch). For example, suppose you are reading the message of ``Bug#1234: foo-mode fails to call frobnicate on startup'' in a message buffer. You decide to fix it, so you switch to the source code, add in the missing call and commit locally, with the commit message ``* lisp/foo-mode.el (foo-mode): Call frobnicate (Bug#1234).'' Use @kbd{C-x v l} to run @code{vc-print-log}, and navigate to the new commit. Invoke the command @code{debbugs-gnu-pick-commits} and press @kbd{RET} to accept the default bug number (which will be 1234 since it's in the commit message) in response to the prompt. You are then popped to the message buffer, and when you reply to the message, press @kbd{p} to post the git formatted patch as an attachment for review, and then answer @kbd{y} to tag the bug with @code{"patch"} when the message is sent. Assuming you get favorable reviews, you then push it, and again call @code{debbugs-gnu-pick-commits} but this time press @kbd{a} (for ``announce'') after replying to the relevant bug thread message. This will insert some text describing the commit and where it was pushed to, and answering @kbd{y} will arrange for the bug to be closed when the message is sent. @node Customizing debbugs-gnu-pick-commits @subsection Customizing debbugs-gnu-pick-commits @vindex debbugs-gnu-read-commit-range-hook The query for commit (or commit range) to use is controlled by @code{debbugs-gnu-read-commit-range-hook}. Initially it has an entry which operates in @samp{*vc-change-log*} buffers: the default will be the commit under point, or the commit range contained in the region if it is active. @vindex debbugs-gnu-commit-description-format @vindex debbugs-gnu-git-remote-info-alist The string inserted to describe an announced commit is controlled by the variable @code{debbugs-gnu-commit-description-format}, it is a format string passed to the @code{--format} argument of @code{git show}. Additionally, if the remote url matches an entry in @code{debbugs-gnu-git-remote-info-alist}, then its @code{commit-url} subitem is appended to the commit description. By default this variable is configured for the GNU Emacs and GNU ELPA repositories.