Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nix-env documentation for --delete-generations #3048

Merged
merged 2 commits into from Aug 29, 2019

Conversation

toonn
Copy link
Contributor

@toonn toonn commented Aug 17, 2019

The documentation for --delete-generations had an erroneous fullstop
and as it turns out inaccurate information on the +No. syntax.

The documentation for `--delete-generations` had an erroneous fullstop
and as it turns out inaccurate information on the `+No.` syntax.
@grahamc grahamc added this to the Nix 2.3 milestone Aug 27, 2019
current generation. Periodically deleting old generations is important
to make garbage collection effective.</para>
generation that was active at that point in time), or a value such as
<literal>+5</literal> to only keep the specified number of generations.
Copy link
Member

@grahamc grahamc Aug 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the way it was worded is correct. Look at this example:

[grahamc@Petunia:~]$ nix-env --delete-generations
1   --  2019-01-28 15:21:11
2   --  2019-02-20 12:21:05
3   --  2019-02-20 12:35:18
4   --  2019-02-22 14:44:43
5   --  2019-02-28 11:18:41
6   --  2019-03-01 11:42:42
7   --  2019-03-05 09:03:49
8   --  2019-03-13 09:45:32
9   --  2019-03-20 15:02:06
10  --  2019-03-27 12:32:19
11  --  2019-03-28 11:47:26
12  --  2019-03-28 11:47:50
13  --  2019-03-28 12:14:11
14  --  2019-04-05 11:29:49
15  --  2019-04-18 10:28:40
16  --  2019-05-08 19:54:06
17  --  2019-05-08 19:57:47
18  --  2019-06-07 13:30:09
19  --  2019-06-19 04:34:10
20  --  2019-06-19 05:45:51
21  --  2019-06-19 10:37:04
22  --  2019-06-19 10:40:51
23  --  2019-07-31 20:45:46
24  --  2019-08-17 16:42:10
25  --  2019-08-17 16:42:16
26  --  2019-08-17 16:43:58
27  --  2019-08-17 16:44:02
28  --  2019-08-17 16:44:07
29  --  2019-08-17 17:00:56
30  --  2019-08-17 17:01:03
31  --  2019-08-17 17:01:45
32  --  2019-08-17 17:01:52
33  --  2019-08-17 17:02:01
34  --  2019-08-17 17:02:31
35  --  2019-08-17 17:02:35
36  --  2019-08-17 17:02:59
37  --  2019-08-17 17:03:42
38  --  2019-08-17 17:03:46
39  --  2019-08-20 10:10:41
40  --  2019-08-20 10:52:13   (current)

I roll back to generation 30:

[grahamc@Petunia:~]$ nix-env --rollback
switching from generation 40 to 39

[grahamc@Petunia:~]$ nix-env --rollback
switching from generation 39 to 38

[grahamc@Petunia:~]$ nix-env --rollback
switching from generation 38 to 37

[grahamc@Petunia:~]$ nix-env --rollback
switching from generation 37 to 36

[grahamc@Petunia:~]$ nix-env --rollback
switching from generation 36 to 35

[grahamc@Petunia:~]$ nix-env --rollback
switching from generation 35 to 34

[grahamc@Petunia:~]$ nix-env --rollback
switching from generation 34 to 33

[grahamc@Petunia:~]$ nix-env --rollback
switching from generation 33 to 32

[grahamc@Petunia:~]$ nix-env --rollback
switching from generation 32 to 31

[grahamc@Petunia:~]$ nix-env --rollback
switching from generation 31 to 30

and then run --delete-generations 5:

[grahamc@Petunia:~]$ nix-env --delete-generations +5
removing generation 25
removing generation 24
removing generation 23
removing generation 22
removing generation 21
removing generation 20
removing generation 19
removing generation 18
removing generation 17
removing generation 16
removing generation 15
removing generation 14
removing generation 13
removing generation 12
removing generation 11
removing generation 10
removing generation 9
removing generation 8
removing generation 7
removing generation 6
removing generation 5
removing generation 4
removing generation 3
removing generation 2
removing generation 1

and I still have these generations:

26  --  2019-08-17 16:43:58
27  --  2019-08-17 16:44:02
28  --  2019-08-17 16:44:07
29  --  2019-08-17 17:00:56
30  --  2019-08-17 17:01:03   (current)
31  --  2019-08-17 17:01:45
32  --  2019-08-17 17:01:52
33  --  2019-08-17 17:02:01
34  --  2019-08-17 17:02:31
35  --  2019-08-17 17:02:35
36  --  2019-08-17 17:02:59
37  --  2019-08-17 17:03:42
38  --  2019-08-17 17:03:46
39  --  2019-08-20 10:10:41
40  --  2019-08-20 10:52:13

My attempt at clarifying the docs resulted in a false explanation. This
is now fixed and I added an example to eliminate all possible confusion.
@edolstra edolstra merged commit 8478c99 into NixOS:master Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants