From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "amano.kenji" Newsgroups: gmane.emacs.help Subject: Re: package-vc.el should not fetch all commits. Date: Fri, 01 Mar 2024 22:53:55 +0000 Message-ID: References: <4MaX8DWHJtqVVefdFcw4d0NbWWHGOR31FY0SDRpGk0O9hKn5J7CWuQzi8lsWx9YDdPhWoG-EfpK655MweVmsp2Lrl2IgydWCd0QAp9ntLlo=@proton.me> <8734taule1.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21575"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "help-gnu-emacs@gnu.org" To: Philip Kaludercic Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 01 23:55:10 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rgBmY-0005PE-7L for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 01 Mar 2024 23:55:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgBlu-0002fx-K2; Fri, 01 Mar 2024 17:54:30 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rgBls-0002fD-3v for help-gnu-emacs@gnu.org; Fri, 01 Mar 2024 17:54:28 -0500 Original-Received: from mail-0301.mail-europe.com ([188.165.51.139]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rgBlo-0000YI-64 for help-gnu-emacs@gnu.org; Fri, 01 Mar 2024 17:54:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1709333656; x=1709592856; bh=Nvqd5T2om3Yld2bWtvKqWfi/OzvzNHJI879/oRwuelc=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=T2qNGxgGt9Fziv3ezmk1Age00hv7eMW0F2cB7cGfDG1I9K/jomH2gEnN6yODU1Heo o+VZu6brHot3ndZB8OhjkvJT0y8WCkDEZVSsOPvdelJGZ+j+dP5/Mo7VCdWJNqQVqw u7ilWidcTr2q8QiIt4gRag9l6dxFeaR148KbuBCshDawmShZo2dJStiZNghR+SN3Qw cISfPHeqCwvjIZCipuFl3oUdpD/+mnwuu37gVQRQFNTUh8nS8MNUCX3UdZuxRdV0H+ D3nAhsmB1ABqKm9TpLTUrz6CHMoknLENw6NwY9LDbUtucDogbbXarDrcjtQ4Oo/g5D JvN0USC0b+Kcg== In-Reply-To: <8734taule1.fsf@posteo.net> Feedback-ID: 48725158:user:proton Received-SPF: pass client-ip=188.165.51.139; envelope-from=amano.kenji@proton.me; helo=mail-0301.mail-europe.com 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146014 Archived-At: I can contribute patches even if I have only one specific commit or the lat= est commit. That's a bad UX. package-vc.el is the only built-in way to install VCS pack= ages, and there should be a built-in way to install only one commit and upd= ate to only one commit. Gentoo linux achieved one-commit update and one-commit installation for its= own package repositories because people did not want repositories to grow = in size over time. On Friday, March 1st, 2024 at 1:33 PM, Philip Kaludercic wrote: > "amano.kenji" amano.kenji@proton.me writes: >=20 > > package-vc-install fetches all commits for a VCS emacs package. > >=20 > > I just want the latest. > >=20 > > package-vc-upgrade and package-vc-upgrade-all should prune everything e= xcept the latest commit. > >=20 > > I don't want VCS packages to grow in size over time. >=20 >=20 > 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: >=20 > --8<---------------cut here---------------start------------->8--- >=20 > (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--- >=20 >=20 > 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. >=20 > -- > Philip Kaludercic on peregrine