Subject: Re: bug#35362: 26.2; [debbugs.el] Automate commit -> debbugs flow (posting patches, closing bugs after pushing)

From: Michael Albinus <[email-masked]>
Date: Sun, 21 Apr 2019 21:58:51 +0200

Noam Postavsky <[email-masked]> writes:

Hi Noam,

I haven't tried your patch yet. Just some first comments while reading it:

All your defcustoms miss a :version tag. I guess, "27.1" is proper.

>    ;; 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?

> +(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.)

> +(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'?

> +    (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?

> +@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.

> +@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).
> +
> +@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.

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.

Best regards, Michael.