Skip to content

Commit abb7d2a

Browse files
committed
Sort the builtins.fetchTree doc's lists
This makes the output easier to compare with the new machine-generated lists in NixOS#9732. The hand-curated order did have the advantage of putting more important attributes at the top, but I don't think it is worth preserving that when `std::map` is so much easier to work with. The right solution to leading the reader to the more important attributes is to call them out in the intro texts.
1 parent 918c1a9 commit abb7d2a

File tree

1 file changed

+50
-50
lines changed

1 file changed

+50
-50
lines changed

src/libexpr/primops/fetchTree.cc

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -317,43 +317,33 @@ static RegisterPrimOp primop_fetchTree({
317317
> }
318318
> ```
319319
320-
- `"tarball"`
320+
- `"git"`
321321
322-
Download a tar archive and extract it into the Nix store.
323-
This has the same underlying implementation as [`builtins.fetchTarball`](@docroot@/language/builtins.md#builtins-fetchTarball)
322+
Fetch a Git tree and copy it to the Nix store.
323+
This is similar to [`builtins.fetchGit`](@docroot@/language/builtins.md#builtins-fetchGit).
324324
325-
- `url` (String, required)
325+
- `allRefs` (Bool, optional)
326326
327-
> **Example**
328-
>
329-
> ```nix
330-
> fetchTree {
331-
> type = "tarball";
332-
> url = "https://github.com/NixOS/nixpkgs/tarball/nixpkgs-23.11";
333-
> }
334-
> ```
327+
By default, this has no effect. This becomes relevant only once `shallow` cloning is disabled.
335328
336-
- `"git"`
329+
Whether to fetch all references (eg. branches and tags) of the repository.
330+
With this argument being true, it's possible to load a `rev` from *any* `ref`.
331+
(Without setting this option, only `rev`s from the specified `ref` are supported).
337332
338-
Fetch a Git tree and copy it to the Nix store.
339-
This is similar to [`builtins.fetchGit`](@docroot@/language/builtins.md#builtins-fetchGit).
333+
Default: `false`
340334
341-
- `url` (String, required)
335+
- `lastModified` (Integer, optional)
342336
343-
The URL formats supported are the same as for Git itself.
337+
Unix timestamp of the fetched commit.
344338
345-
> **Example**
346-
>
347-
> ```nix
348-
> fetchTree {
349-
> type = "git";
350-
> url = "[email protected]:NixOS/nixpkgs.git";
351-
> }
352-
> ```
339+
If set, pass through the value to the output attribute set.
340+
Otherwise, generated from the fetched Git tree.
353341
354-
> **Note**
355-
>
356-
> If the URL points to a local directory, and no `ref` or `rev` is given, Nix only considers files added to the Git index, as listed by `git ls-files` but use the *current file contents* of the Git working directory.
342+
- `lfs` (Bool, optional)
343+
344+
Fetch any [Git LFS](https://git-lfs.com/) files.
345+
346+
Default: `false`
357347
358348
- `ref` (String, optional)
359349
@@ -369,6 +359,13 @@ static RegisterPrimOp primop_fetchTree({
369359
370360
Default: the tip of `ref`
371361
362+
- `revCount` (Integer, optional)
363+
364+
Number of revisions in the history of the Git repository before the fetched commit.
365+
366+
If set, pass through the value to the output attribute set.
367+
Otherwise, generated from the fetched Git tree.
368+
372369
- `shallow` (Bool, optional)
373370
374371
Make a shallow clone when fetching the Git tree.
@@ -382,35 +379,38 @@ static RegisterPrimOp primop_fetchTree({
382379
383380
Default: `false`
384381
385-
- `lfs` (Bool, optional)
386-
387-
Fetch any [Git LFS](https://git-lfs.com/) files.
388-
389-
Default: `false`
390-
391-
- `allRefs` (Bool, optional)
392-
393-
By default, this has no effect. This becomes relevant only once `shallow` cloning is disabled.
394-
395-
Whether to fetch all references (eg. branches and tags) of the repository.
396-
With this argument being true, it's possible to load a `rev` from *any* `ref`.
397-
(Without setting this option, only `rev`s from the specified `ref` are supported).
382+
- `url` (String, required)
398383
399-
Default: `false`
384+
The URL formats supported are the same as for Git itself.
400385
401-
- `lastModified` (Integer, optional)
386+
> **Example**
387+
>
388+
> ```nix
389+
> fetchTree {
390+
> type = "git";
391+
> url = "[email protected]:NixOS/nixpkgs.git";
392+
> }
393+
> ```
402394
403-
Unix timestamp of the fetched commit.
395+
> **Note**
396+
>
397+
> If the URL points to a local directory, and no `ref` or `rev` is given, Nix only considers files added to the Git index, as listed by `git ls-files` but use the *current file contents* of the Git working directory.
404398
405-
If set, pass through the value to the output attribute set.
406-
Otherwise, generated from the fetched Git tree.
399+
- `"tarball"`
407400
408-
- `revCount` (Integer, optional)
401+
Download a tar archive and extract it into the Nix store.
402+
This has the same underlying implementation as [`builtins.fetchTarball`](@docroot@/language/builtins.md#builtins-fetchTarball)
409403
410-
Number of revisions in the history of the Git repository before the fetched commit.
404+
- `url` (String, required)
411405
412-
If set, pass through the value to the output attribute set.
413-
Otherwise, generated from the fetched Git tree.
406+
> **Example**
407+
>
408+
> ```nix
409+
> fetchTree {
410+
> type = "tarball";
411+
> url = "https://github.com/NixOS/nixpkgs/tarball/nixpkgs-23.11";
412+
> }
413+
> ```
414414
415415
The following input types are still subject to change:
416416

0 commit comments

Comments
 (0)