From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.help Subject: Re: package-vc.el should not fetch all commits. Date: Sat, 02 Mar 2024 06:53:52 +0000 Message-ID: <87o7bx3z0f.fsf@posteo.net> References: <4MaX8DWHJtqVVefdFcw4d0NbWWHGOR31FY0SDRpGk0O9hKn5J7CWuQzi8lsWx9YDdPhWoG-EfpK655MweVmsp2Lrl2IgydWCd0QAp9ntLlo=@proton.me> <8734taule1.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40297"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "help-gnu-emacs@gnu.org" To: "amano.kenji" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 02 07:55:00 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 1rgJGu-000AH2-FH for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 02 Mar 2024 07:55:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgJG9-0003os-FL; Sat, 02 Mar 2024 01:54:13 -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 1rgJFx-0003dQ-NA for help-gnu-emacs@gnu.org; Sat, 02 Mar 2024 01:54:05 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rgJFs-00066E-6j for help-gnu-emacs@gnu.org; Sat, 02 Mar 2024 01:54:00 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A1CD4240027 for ; Sat, 2 Mar 2024 07:53:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1709362433; bh=qdq3aBUoULAODoSu/Gs6wAZE4LW/oyqpWS/BZUhvbtI=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=bG8SVqMDGgGrc29Z5R3SHVznFXsLJApHRv7WoUTVeDEsseAP5N9hGIXx8PmKMzNpT VnkIfBL7/rHV52LXYn/TgcURP/bFWvBJQcKFUOEeXAOhgHtU5xUtUAjwf3qyuI7KuH zg7kEzkl4z0ee6MrdT0anEGMKkk8cA3f+4WtkctkJp5fRE09839szXyje5/2nX7S4t 8GMQY6CnApw0EsEkc9LRslSa8/JS8ATVGs2HwCafgXVL/bzA0KStmzhttAxh+dUkSv PeDC4WZ6lesfJylOLjOGeR2MMjnGjTHcVTQ3EFZHalYOJNPwQg2lRCLpJ7M8dDG5xa 7Z+/LQUJdUgJw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TmwfS6nGkz6txn; Sat, 2 Mar 2024 07:53:52 +0100 (CET) In-Reply-To: (amano kenji's message of "Fri, 01 Mar 2024 22:53:55 +0000") OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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:146016 Archived-At: "amano.kenji" writes: > I can contribute patches even if I have only one specific commit or the latest commit. True, my bad I didn't realise that for patches, Git won't have a problem with that, even though it seems obvious in retrospect. A different problem would seem to be updating, or at least a "git pull" would download the entire repository. > That's a bad UX. package-vc.el is the only built-in way to install VCS > packages, and there should be a built-in way to install only one > commit and update to only one commit. I find these claims difficult, since as mentioned before, the intention behind writing package-vc is not just to install a package from a VCS, and judging it as such is misguided IMO. But feel free to work on it, I am not opposed to patches that wouldn't violate the fundamental intentions behind package-vc, but I suspect that the end-result will be a more advanced version of the command I provided below. Also, if you intend to work on this more seriously, we should move the conversation to the bug tracker or private correspondence for the time being, where we can discuss details and ideas. > 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. I am not familiar with Gentoo or why they build from Source (my impression has always been that this is partially motivated by a performance concern, and the ability to compile optimised executable for the current system?). > On Friday, March 1st, 2024 at 1:33 PM, Philip Kaludercic wrote: > >> "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 -- Philip Kaludercic on peregrine