unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: "amano.kenji" <amano.kenji@proton.me>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: package-vc.el should not fetch all commits.
Date: Fri, 01 Mar 2024 13:33:42 +0000	[thread overview]
Message-ID: <8734taule1.fsf@posteo.net> (raw)
In-Reply-To: <4MaX8DWHJtqVVefdFcw4d0NbWWHGOR31FY0SDRpGk0O9hKn5J7CWuQzi8lsWx9YDdPhWoG-EfpK655MweVmsp2Lrl2IgydWCd0QAp9ntLlo=@proton.me> (amano kenji's message of "Fri, 01 Mar 2024 12:31:16 +0000")

"amano.kenji" <amano.kenji@proton.me> writes:

> package-vc-install fetches all commits for a VCS emacs package.
>
> I just want the latest.
>
> package-vc-upgrade and package-vc-upgrade-all should prune everything except the latest commit.
>
> I don't want VCS packages to grow in size over time.

That is not really what package-vc is about (the intention /is/ to have
the revision history available, so that you can contribute patches).
That being said, if you say you are only interested in packages from
Git, you can use this quick hack:

--8<---------------cut here---------------start------------->8---
(require 'package)
(require 'vc-git)
(defun package-install-once-from-vc (url name)
  (interactive
   (let* ((url (read-string "URL: "))
	  (name (file-name-base (directory-file-name url))))
     (list url (read-string "Name: " name))))
  (let* ((tmp (make-temp-file "package" t))
	 (dir (expand-file-name name tmp)))
    (make-directory dir)
    (unless (vc-git--out-ok "clone" "--depth" "1" url dir)
      (error "Failed to install %s from %s" name url))
    (let ((desc (package-install-file dir)))
      (message "Package `%s' installed at version %s"
	       (package-desc-name desc)
	       (package-version-join
		(package-desc-version desc)))
      desc)))
--8<---------------cut here---------------end--------------->8---

This is still missing some of the conveniences of package-vc, such as
building manuals, resolving dependencies, etc. but you could integrate
`package-vc--unpack-1' into the mix to get that to work as well.  As is
the case with vc-packages in general, updating is difficult.

-- 
	Philip Kaludercic on peregrine



  reply	other threads:[~2024-03-01 13:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 12:31 package-vc.el should not fetch all commits amano.kenji
2024-03-01 13:33 ` Philip Kaludercic [this message]
2024-03-01 22:53   ` amano.kenji
2024-03-02  6:53     ` Philip Kaludercic
2024-03-02 11:46       ` amano.kenji
2024-03-02 14:40         ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-03-03  7:53           ` amano.kenji
2024-03-03 13:58             ` Stefan Monnier
2024-03-04 14:54               ` Philip Kaludercic
2024-03-04 16:30                 ` Stefan Monnier
2024-03-05  5:17                   ` amano.kenji
2024-03-05  9:42                     ` Philip Kaludercic
2024-03-05 15:42                       ` Stefan Monnier via Users list for the GNU Emacs text editor

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=8734taule1.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=amano.kenji@proton.me \
    --cc=help-gnu-emacs@gnu.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).