From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Reorganizing guix package commands Date: Tue, 19 Apr 2016 17:52:17 +0200 Message-ID: <8737qh1tqm.fsf@gnu.org> References: <874mazi99k.fsf@gmail.com> <877ffual6i.fsf@gnu.org> <877ffujasf.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asXwv-0001uo-8O for guix-devel@gnu.org; Tue, 19 Apr 2016 11:52:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asXwq-0007w3-MC for guix-devel@gnu.org; Tue, 19 Apr 2016 11:52:25 -0400 In-Reply-To: <877ffujasf.fsf@gmail.com> (Alex Kost's message of "Tue, 19 Apr 2016 10:52:00 +0300") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Alex Kost Cc: guix-devel@gnu.org Alex Kost skribis: > Ludovic Court=C3=A8s (2016-04-18 20:20 +0300) wrote: [...] >> I can see how adding =E2=80=9Cpackage=E2=80=9D everywhere helps categori= ze things >> mentally, but as a user interface, I think it would be rather bad. > > As a user, I think it would be rather good. (This is just my user opinio= n) To clarify, what I meant is that forcing users to type an additional word for common operations just for the beauty of categorization sounds unwise to me. For instance, I=E2=80=99m happy I can type =E2=80=98ls=E2=80=99 rather than= =E2=80=98gnu core file list=E2=80=99. :-) Similarly, it=E2=80=99s not immediately obvious to me that something like = =E2=80=9Cguix package edit=E2=80=9D and =E2=80=9Cguix package install=E2=80=9D would help= newcomers. On the contrary, they would likely violate the rule of least surprise: most other tools provide sub-commands like =E2=80=9Cinstall=E2=80=9D, some = provide =E2=80=9Cedit=E2=80=9D and =E2=80=9Cbuild=E2=80=9D as well, without further= categorization. >> Also, it=E2=80=99s not that simple: =E2=80=9Cguix size=E2=80=9D can take= a store item instead of >> a package name, =E2=80=9Cguix graph=E2=80=9D cannot do it yet but it wou= ld be useful if >> it could (=E2=80=9Cguix graph -t references $(readlink -f /run/current-s= ystem)=E2=80=9D), >> etc. > > Hm, OK, I'm not sure, but let's leave "graph" and "size" alone for now. But there are many other similar cases. For instance, =E2=80=98guix build= =E2=80=99 can be passed a .drv; =E2=80=98guix archive=E2=80=99 can be passed a package na= me or a store file name, etc. Passing package names is a mere convenience for many of these commands; fundamentally, many operate on store items, derivations, etc. This requires careful consideration. >> I still think that having aliases like =E2=80=9Cguix install=E2=80=9D as= Andy proposed >> long ago would be useful, though I never started working on it. > > I agree! Except I think they should be inside "guix package": > > guix package install ... > guix package remove ... As I view it, the sole purpose of =E2=80=9Cguix install=E2=80=9D and simila= r is to make it easier for newcomers to get started (see ), and to allow users in general to type less. Adding =E2=80=9Cpackage=E2=80=9D in the middle would probably defeat that g= oal. > As for the transactional operations (I mean remove/install in one > command), I think we can do it in a separate "guix profile" command: > > guix profile --install ... --remove ... This sounds good to me. >> There are probably other improvements to do around =E2=80=9Cguix package= =E2=80=9D (maybe >> turning some of its options into separate sub-commands as was suggested >> before.) All we need is a clear view of where we=E2=80=99re going and p= atches. :-) > > Here is the summary of the changes I think it would be good to have: > > | Replace this: | With this: | > |-----------------------------------+-----------------------------------| > | guix build | guix package build | I don=E2=80=99t like this one, for the reasons given above. > | guix edit | guix package definition=C2=B9 = | > | guix import | guix package import | > | guix lint | guix package lint | > | guix refresh | guix package refresh | I suppose the benefit would be that users can type =E2=80=98guix package he= lp=E2=80=99 and see all the sub-commands that relate to packages, right? > | guix package --show | guix package show | > | guix package --search | guix package search | > | guix package --list-available | guix package list | Or just =E2=80=98guix show=E2=80=99, =E2=80=98guix search=E2=80=99, etc.? > |-----------------------------------+-----------------------------------| > | guix package --list-generations | guix profile --list-generations | > | guix package --list-installed | guix profile --list-installed | > | guix package --delete-generations | guix profile --delete-generations | > | guix package --switch-generations | guix profile --switch-generations | > | guix package --roll-back | guix profile --roll-back | > | guix package --manifest | guix profile --manifest | > =C2=B9 "edit" name is confusing: > > Maybe instead of --list-generations and others, these options should > transform into subcommands (list-generations) of "guix profile". I agree. But what should we do of transactions? Thoughts? Ludo=E2=80=99.