all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Glasser <glasser@davidglasser.net>
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: 28637@debbugs.gnu.org
Subject: bug#28637: [PATCH] Display commit in package description, if available
Date: Tue, 10 Oct 2017 15:46:53 -0700	[thread overview]
Message-ID: <CAN7QDoJc05xACCenHGn4zsmzBDknHZXBG8v9OwKXjy=NwYot-g@mail.gmail.com> (raw)
In-Reply-To: <874lr6d3tp.fsf@users.sourceforge.net>

On Tue, Oct 10, 2017 at 3:40 PM, Noam Postavsky
<npostavs@users.sourceforge.net> wrote:
> David Glasser <glasser@davidglasser.net> writes:
>
>> MELPA includes a :commit field in its
>> packages (https://github.com/melpa/package-build/pull/6). You can use
>> this to tell if MELPA has processed a recently-merged change.  This
>> commit adds that metadata to the package description buffer.
>
> Code looks fine, but could you post a "before and after" picture please?
> I'm wondering if it might make sense to abbreviate the hash.

Sure! Here's a randomly chosen melpa package's *Help* page:

```
archive-rpm is a new package.

     Status: New from melpa -- Install
    Archive: melpa
    Version: 20171005.1548
     Commit: 830158cfb3b43c85cfcb4bd5b92d4457d015c80a
    Summary: RPM and CPIO support for archive-mode
   Requires: emacs-24.4

This module adds support for RPM archives to archive-mode.

RPM files consist of metadata plus a compressed CPIO archive, so
this module relies on `archive-cpio'.
```

This is the "after" picture; the "before" picture lacks the Commit line.

Abbreviating the hash might be nice, but it seems like maybe that should be
the job of the code that creates the metadata (ie in melpa's package builder)
rather than the code that displays it.


>> * lisp/emacs-lisp/package.el: Display commit in package description
>
> I think you should have a period at the end of sentence though.

OK, a new version of the patch is below (is this the right way to send
a new version of the patch? I am not used to mail-based git
workflows):

From a4ebfa2ed35a620e4754399da8181caba13a1eb9 Mon Sep 17 00:00:00 2001
From: David Glasser <glasser@davidglasser.net>
Date: Thu, 28 Sep 2017 14:00:04 -0700
Subject: [PATCH] Display commit in package description, if available

MELPA includes a :commit field in its
packages (https://github.com/melpa/package-build/pull/6). You can use
this to tell if MELPA has processed a recently-merged change.  This
commit adds that metadata to the package description buffer.

* lisp/emacs-lisp/package.el: Display commit in package description.
---
 lisp/emacs-lisp/package.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 8b101c1323..dd05c70dc8 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2260,6 +2260,7 @@ Otherwise no newline is inserted."
          (archive (if desc (package-desc-archive desc)))
          (extras (and desc (package-desc-extras desc)))
          (homepage (cdr (assoc :url extras)))
+         (commit (cdr (assoc :commit extras)))
          (keywords (if desc (package-desc--keywords desc)))
          (built-in (eq pkg-dir 'builtin))
          (installable (and archive (not built-in)))
@@ -2332,6 +2333,8 @@ Otherwise no newline is inserted."
     (and version
          (package--print-help-section "Version"
            (package-version-join version)))
+    (when commit
+      (package--print-help-section "Commit" commit))
     (when desc
       (package--print-help-section "Summary"
         (package-desc-summary desc)))





  reply	other threads:[~2017-10-10 22:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-28 23:06 bug#28637: [PATCH] Display commit in package description, if available David Glasser
2017-10-10 19:35 ` bug#28637: " David Glasser
2017-10-10 20:07   ` Eli Zaretskii
2017-10-10 22:05     ` David Glasser
2017-10-10 22:40 ` bug#28637: [PATCH] " Noam Postavsky
2017-10-10 22:46   ` David Glasser [this message]
2017-10-11  1:16     ` Noam Postavsky
2017-10-11  4:14       ` David Glasser
2017-10-11 10:41       ` Eli Zaretskii
2017-10-11 12:32         ` Noam Postavsky
2017-10-11 13:12           ` Eli Zaretskii
2017-10-23 23:58             ` Noam Postavsky
2017-10-24 14:46               ` Eli Zaretskii
2017-10-24 23:26                 ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN7QDoJc05xACCenHGn4zsmzBDknHZXBG8v9OwKXjy=NwYot-g@mail.gmail.com' \
    --to=glasser@davidglasser.net \
    --cc=28637@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.