unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* delete-generations or --delete-generations?
@ 2021-08-27  1:04 Raghav Gururajan
  2021-08-27  2:55 ` Jack Hill
  2021-08-27  9:27 ` zimoun
  0 siblings, 2 replies; 7+ messages in thread
From: Raghav Gururajan @ 2021-08-27  1:04 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 156 bytes --]

Hello Guix!

Why there is no '--' prefix to 'delete-generations' for `guix system`, 
when there is for `guix pull` and `guix package`?

Regards,
RG.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 2649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: delete-generations or --delete-generations?
  2021-08-27  1:04 delete-generations or --delete-generations? Raghav Gururajan
@ 2021-08-27  2:55 ` Jack Hill
  2021-08-27  9:27 ` zimoun
  1 sibling, 0 replies; 7+ messages in thread
From: Jack Hill @ 2021-08-27  2:55 UTC (permalink / raw)
  To: Raghav Gururajan; +Cc: guix-devel

On Thu, 26 Aug 2021, Raghav Gururajan wrote:

> Hello Guix!
>
> Why there is no '--' prefix to 'delete-generations' for `guix system`, when 
> there is for `guix pull` and `guix package`?

Raghav,

I don't know (but I'll speculate in a bit), but it's not just 
delete-generations. All of the guix system subcommands (e.g. init, 
reconfigure, list-generations) are like that. I suspect this is due to the 
organization of all these system-related subcommands under one top level 
command. These subcommands are different than options like --no-substittue 
and --keep-failed.

I do see what you mean by it being organized a little bit differently than 
the other guix commands though. I guess it would be closer if there were a 
guix system generations subcommand with --delete --list etc. options. I 
have no opinion if this would make sense the implement though.

Hope that helps,
Jack


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: delete-generations or --delete-generations?
  2021-08-27  1:04 delete-generations or --delete-generations? Raghav Gururajan
  2021-08-27  2:55 ` Jack Hill
@ 2021-08-27  9:27 ` zimoun
  2021-09-08 20:59   ` Ludovic Courtès
  1 sibling, 1 reply; 7+ messages in thread
From: zimoun @ 2021-08-27  9:27 UTC (permalink / raw)
  To: Raghav Gururajan, guix-devel

Hi Raghav,

On Thu, 26 Aug 2021 at 21:04, Raghav Gururajan <rg@raghavgururajan.name> wrote:

> Why there is no '--' prefix to 'delete-generations' for `guix system`, 
> when there is for `guix pull` and `guix package`?

I speculate too. :-) I guess because the idea behind “guix system” is
one action at a time however “guix package” can compose actions in one
transaction (guix package --install=foo --remove=bar).  Using the
default CLI parser (SRFI-37), it seems easier for composing to use the
options (--<name-it>) than to extract actions.  For instance, if it was
“guix package <action>” as it is with “guix system”, then it is harder
to parse the composition, i.e.,

  guix package install foo remove bar

Aside the CLI parser is more work than just using ’args-fold’ from
SRFI-37, ambiguities happen: consider the case where ’remove’ is also a
package, for instance.

Then the other actions (--list-generations, --show, --search, etc.)
would inherit from this initial “guix package” design about composition
for a install/remove transactions.

Well, I agree that “guix system” is inconsistent with the rest of
commands.  First, “guix system” does not enjoy the typo hinter:

  $ guix system delte-generations
  guix system: error: delte-generations: unknown action

compared to:

  $ guix package --delte-generations
  guix package: error: delte-generations: unrecognized option
  hint: Did you mean `delete-generations'?

Well, although it is obviously fixable. ;-) Second, it leads to corner
cases as describe by the manual, for instance,

  $ guix system delete-generation -1
  guix system: error: 1: unrecognized option

here ’-1’ is considered by the parser as a short option, so one needs:

  $ guix system delete-generation -- -1

Issue which does not happen using “--delete-generation”. :-)

On the other hand, the composition is not totally true, for instance:

  $ guix package --show=cuirass --search="GNU hello"
  name: hello
  …

  $ guix package  --search="GNU hello" --show=cuirass
  name: cuirass
  …

although it is debatable to compose them. :-)


Ah consistent CLI, so complicated topic! ;-)


Cheers,
simon

PS: It reminds me issues with short-name accepting optional argument:

   guix package -I -p /tmp/profile # fails
   guix package -p /tmp/profile -I # works

<http://issues.guix.gnu.org/40549#19> where a next action is described
here <http://issues.guix.gnu.org/40549#22>. :-)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: delete-generations or --delete-generations?
  2021-08-27  9:27 ` zimoun
@ 2021-09-08 20:59   ` Ludovic Courtès
  2021-09-09 13:47     ` Leo Famulari
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2021-09-08 20:59 UTC (permalink / raw)
  To: zimoun; +Cc: guix-devel, Raghav Gururajan

Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

> I speculate too. :-) I guess because the idea behind “guix system” is
> one action at a time however “guix package” can compose actions in one
> transaction (guix package --install=foo --remove=bar).  Using the
> default CLI parser (SRFI-37), it seems easier for composing to use the
> options (--<name-it>) than to extract actions.  For instance, if it was
> “guix package <action>” as it is with “guix system”, then it is harder
> to parse the composition, i.e.,

Yeah, long ago Alex Kost and others proposed turning some of the current
‘guix package’ options into sub-sub-commands of a new ‘guix profile’
sub-command: ‘guix profile install foo’, ‘guix profile
delete-generations’, etc.

It may be consistent but maybe a bit far-fetched and annoying to type…

Ludo’.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: delete-generations or --delete-generations?
  2021-09-08 20:59   ` Ludovic Courtès
@ 2021-09-09 13:47     ` Leo Famulari
  2021-09-09 14:14       ` André A. Gomes
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Famulari @ 2021-09-09 13:47 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel, Raghav Gururajan

On Wed, Sep 08, 2021 at 10:59:33PM +0200, Ludovic Courtès wrote:
> zimoun <zimon.toutoune@gmail.com> skribis:
> > I speculate too. :-) I guess because the idea behind “guix system” is
> > one action at a time however “guix package” can compose actions in one
> > transaction (guix package --install=foo --remove=bar).  Using the
> > default CLI parser (SRFI-37), it seems easier for composing to use the
> > options (--<name-it>) than to extract actions.  For instance, if it was
> > “guix package <action>” as it is with “guix system”, then it is harder
> > to parse the composition, i.e.,

Makes sense.

> Yeah, long ago Alex Kost and others proposed turning some of the current
> ‘guix package’ options into sub-sub-commands of a new ‘guix profile’
> sub-command: ‘guix profile install foo’, ‘guix profile
> delete-generations’, etc.

That's an interesting idea and might help to educate new users on
'profiles', which is a crucial concept for Guix but sometimes learned
later than would be ideal.

One of the good things about Guix compared to Nix (and most distros) is
that the command-line interface is more discoverable and consistent (and
composable!). So, we should try to keep improving it in that direction.
Although in my opinion we should also be careful not to change it too
radically.

I think that adding `guix system --delete-generations` et al would not
be confusing for anyone.

> It may be consistent but maybe a bit far-fetched and annoying to type…

`guix profile` is more correct and consistent, although it would
represent a major change in the command-line interface, which I figure
would hurt usability. Just think of all the "how to use Guix" guides
that people have written; they'd all become stale.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: delete-generations or --delete-generations?
  2021-09-09 13:47     ` Leo Famulari
@ 2021-09-09 14:14       ` André A. Gomes
  2021-09-09 14:44         ` Leo Famulari
  0 siblings, 1 reply; 7+ messages in thread
From: André A. Gomes @ 2021-09-09 14:14 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel, Raghav Gururajan

Leo Famulari <leo@famulari.name> writes:

> I think that adding `guix system --delete-generations` et al would not
> be confusing for anyone.

Let me share the position of a layperson.  I noticed the lack of
symmetry between `guix system list-generations` and `guix package
--list-generations` and it felt like an inconsistency to me.


-- 
André A. Gomes
"Free Thought, Free World"


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: delete-generations or --delete-generations?
  2021-09-09 14:14       ` André A. Gomes
@ 2021-09-09 14:44         ` Leo Famulari
  0 siblings, 0 replies; 7+ messages in thread
From: Leo Famulari @ 2021-09-09 14:44 UTC (permalink / raw)
  To: André A. Gomes; +Cc: guix-devel, Raghav Gururajan

On Thu, Sep 09, 2021 at 05:14:53PM +0300, André A. Gomes wrote:
> Let me share the position of a layperson.  I noticed the lack of
> symmetry between `guix system list-generations` and `guix package
> --list-generations` and it felt like an inconsistency to me.

And sometimes it confuses me too, even though I've been using Guix since
2015 :)


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-09 14:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-27  1:04 delete-generations or --delete-generations? Raghav Gururajan
2021-08-27  2:55 ` Jack Hill
2021-08-27  9:27 ` zimoun
2021-09-08 20:59   ` Ludovic Courtès
2021-09-09 13:47     ` Leo Famulari
2021-09-09 14:14       ` André A. Gomes
2021-09-09 14:44         ` Leo Famulari

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).