diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2026-04-23 22:19:38 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-05-10 17:01:08 +0200 |
| commit | 03b2e7f34a7d4bf100a7ab2452dae3f8e9ace8dd (patch) | |
| tree | 058faace7fd0b3ba1df76ea774ae21d167ee4dee | |
| parent | c9dcd203e5356f13b736d5be121fd61874be1a93 (diff) | |
doc: Add a list of ‘guix hash’ examples.
* doc/guix.texi (Invoking guix hash): Add examples.
(Invoking guix time-machine): Add cross reference.
Change-Id: I128d8a884f26e580955a0316caa2e119cff4498b
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| -rw-r--r-- | doc/guix.texi | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index a2c79346777..e2df50ab267 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -5141,7 +5141,8 @@ This command downloads the data designated by the identifier from | |||
| 5141 | archive}; it is fully reproducible because the data it refers to is | 5141 | archive}; it is fully reproducible because the data it refers to is |
| 5142 | immutable. | 5142 | immutable. |
| 5143 | 5143 | ||
| 5144 | @xref{Invoking guix pull}, for more information. | 5144 | @xref{Invoking guix pull}, for more information, and @pxref{Invoking |
| 5145 | guix hash}, for info on how to compute the SWHID of a file. | ||
| 5145 | 5146 | ||
| 5146 | @item --allow-untrusted-channels[=yes|no] | 5147 | @item --allow-untrusted-channels[=yes|no] |
| 5147 | Whether to allow pulls from untrusted channels. | 5148 | Whether to allow pulls from untrusted channels. |
| @@ -14834,8 +14835,32 @@ guix hash @var{option} @var{file} ... | |||
| 14834 | @end example | 14835 | @end example |
| 14835 | 14836 | ||
| 14836 | When @var{file} is @code{-} (a hyphen), @command{guix hash} computes the | 14837 | When @var{file} is @code{-} (a hyphen), @command{guix hash} computes the |
| 14837 | hash of data read from standard input. @command{guix hash} has the | 14838 | hash of data read from standard input. |
| 14838 | following options: | 14839 | |
| 14840 | Here are a few examples: | ||
| 14841 | |||
| 14842 | @table @asis | ||
| 14843 | @item SHA256 of a file for use in an @code{origin} record: | ||
| 14844 | @example | ||
| 14845 | guix hash example.tar.gz | ||
| 14846 | @end example | ||
| 14847 | |||
| 14848 | @item SHA256 of directory @var{checkout} for use in an @code{origin} record: | ||
| 14849 | @example | ||
| 14850 | guix hash -rx @var{checkout} | ||
| 14851 | @end example | ||
| 14852 | |||
| 14853 | @item SHA1 hash of @var{file} like the @code{sha1sum} command: | ||
| 14854 | @example | ||
| 14855 | guix hash -H sha1 -f hex @var{file} | ||
| 14856 | @end example | ||
| 14857 | |||
| 14858 | @cindex SWHID, computing | ||
| 14859 | @item SHA1 hash of @var{file} for a @code{swh:1:cnt} @uref{https://swhid.org, SWHID}: | ||
| 14860 | guix hash -S git -H sha1 -f hex @var{file} | ||
| 14861 | @end table | ||
| 14862 | |||
| 14863 | @command{guix hash} has the following options: | ||
| 14839 | 14864 | ||
| 14840 | @table @code | 14865 | @table @code |
| 14841 | 14866 | ||
