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: Sat, 02 Mar 2024 11:46:21 +0000 Message-ID: References: <4MaX8DWHJtqVVefdFcw4d0NbWWHGOR31FY0SDRpGk0O9hKn5J7CWuQzi8lsWx9YDdPhWoG-EfpK655MweVmsp2Lrl2IgydWCd0QAp9ntLlo=@proton.me> <8734taule1.fsf@posteo.net> <87o7bx3z0f.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="7634"; 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 Sat Mar 02 12:47:37 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 1rgNq4-0001mz-Ux for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 02 Mar 2024 12:47:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgNpW-000669-FL; Sat, 02 Mar 2024 06:47:02 -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 1rgNpT-00065h-Ih for help-gnu-emacs@gnu.org; Sat, 02 Mar 2024 06:46:59 -0500 Original-Received: from mail-4318.protonmail.ch ([185.70.43.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rgNpP-0006Nh-CT for help-gnu-emacs@gnu.org; Sat, 02 Mar 2024 06:46:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=dndpofofm5dbfbf7s4gs7uesri.protonmail; t=1709380012; x=1709639212; bh=StnLf0muvePeH+eZ9hY7hzGRFp4MABrJ08ZPtG/k6CA=; 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=gvn2fjfyx19Db1sXDYGcqP2fmqVBtdf3YPi7soyD1xTF6fbOSb1zFkIOoxYtPhKWT KizBx0tdCoG4b+9a8OyNUPin2q0nvU2UmR4z0xuVE6cjT+7YPhjPryee1iR5R5TJHj CPv+c65te5OFodnLfQHq9fxapw2RDj2X8FujdnENEa2uJMRLuBPK1fDA0z7l9M2Tf7 pyyiDxLNaaW49FZffDolYjY/lDhHG3ONoGUlfGUvUjaBcWbSHul0yaro1wuA8y5TAG MDnlEkK9sa/4gVoQ5du3LVkKljuje429CqyAe7kzGqWFTPCJc6Zfi2DhMmjed1+SoN ybEyL7IBfbN+w== In-Reply-To: <87o7bx3z0f.fsf@posteo.net> Feedback-ID: 48725158:user:proton Received-SPF: pass client-ip=185.70.43.18; envelope-from=amano.kenji@proton.me; helo=mail-4318.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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:146018 Archived-At: I have developed a few small softwares. Unfortunately, I'm trying to gradua= te software development. I want to stick to software tinkering. I just want= to write a few tiny scripts here and there, and I don't know much about em= acs lisp. I don't know the intention behind package-vc.el, but I think it should be f= lexible enough to keep commit depth at 1 during installation and updates. T= hat's not difficult if you know some git commands. Gentoo linux keeps commi= t depth at 1 for all package repositories by default. When people use package-vc.el, in many cases, they have to use it because t= he desired packages aren't available on emacs package repositories. janet-t= s-mode is one example. I just want the latest commit from VCS packages that= are not available on emacs package repositories. If no one wants to make package-vc.el flexible enough to do that, I guess I= will just stick to elpaca. On Saturday, March 2nd, 2024 at 6:53 AM, Philip Kaludercic wrote: > "amano.kenji" amano.kenji@proton.me writes: >=20 > > I can contribute patches even if I have only one specific commit or the= latest commit. >=20 >=20 > 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. >=20 > A different problem would seem to be updating, or at least a "git pull" > would download the entire repository. >=20 > > 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. >=20 >=20 > 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. >=20 > 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. >=20 > 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. >=20 > > 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. >=20 >=20 > 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?). >=20 > > On Friday, March 1st, 2024 at 1:33 PM, Philip Kaludercic philipk@posteo= .net wrote: > >=20 > > > "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 everythi= ng except the latest commit. > > > >=20 > > > > I don't want VCS packages to grow in size over time. > > >=20 > > > That is not really what package-vc is about (the intention /is/ to ha= ve > > > 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 > > > This is still missing some of the conveniences of package-vc, such as > > > building manuals, resolving dependencies, etc. but you could integrat= e > > > `package-vc--unpack-1' into the mix to get that to work as well. As i= s > > > the case with vc-packages in general, updating is difficult. > > >=20 > > > -- > > > Philip Kaludercic on peregrine >=20 >=20 > -- > Philip Kaludercic on peregrine