summary refs log tree commit diff
path: root/doc/guix.texi
diff options
context:
space:
mode:
authorRomain GARBAGE <romain.garbage@inria.fr>2024-01-22 11:32:55 +0100
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2024-01-22 10:02:28 -0500
commit916fb5347ab8d441e92ec6bfb13f9e9fef524ff7 (patch)
treeab7c980809ece44906aa70426012facae110449b /doc/guix.texi
parent1bdeec5d66cfeea3a5fc5d69690dd32cb32ee104 (diff)
downloadguix-916fb5347ab8d441e92ec6bfb13f9e9fef524ff7.tar.gz
guix: download: Add support for git repositories.
* guix/scripts/download.scm (git-download-to-store*): Add new variable.
(copy-recursively-without-dot-git): New variable.
(git-download-to-file): Add new variable.
(show-help): Add 'git', 'commit', 'branch' and 'recursive'options
help message.
(%default-options): Add default value for 'git-reference' and
'recursive' options.
(%options): Add 'git', 'commit', 'branch' and 'recursive' command
line options.
(guix-download) [hash]: Compute hash with 'file-hash*' instead of
'port-hash' from (gcrypt hash) module. This allows us to compute
hashes for directories.
* doc/guix.texi (Invoking guix-download): Add @item entries for
`git', `commit', `branch' and `recursive' options. Add a paragraph in
the introduction.
* tests/guix-download.sh: New tests. Move variables and trap definition
to the top of the file.

Change-Id: Ic2c428dca4cfcb0d4714ed361a4c46609339140a
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'doc/guix.texi')
-rw-r--r--doc/guix.texi23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 110853b98c..a6187690bb 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -14021,6 +14021,9 @@ the certificates of X.509 authorities from the directory pointed to by
 the @env{SSL_CERT_DIR} environment variable (@pxref{X.509
 Certificates}), unless @option{--no-check-certificate} is used.
 
+Alternatively, @command{guix download} can also retrieve a Git
+repository, possibly a specific commit, tag, or branch.
+
 The following options are available:
 
 @table @code
@@ -14045,6 +14048,26 @@ URL, which makes you vulnerable to ``man-in-the-middle'' attacks.
 @itemx -o @var{file}
 Save the downloaded file to @var{file} instead of adding it to the
 store.
+
+@item --git
+@itemx -g
+Checkout the Git repository at the latest commit on the default branch.
+
+@item --commit=@var{commit-or-tag}
+Checkout the Git repository at @var{commit-or-tag}.
+
+@var{commit-or-tag} can be either a tag or a commit defined in the Git
+repository.
+
+@item --branch=@var{branch}
+Checkout the Git repository at @var{branch}.
+
+The repository will be checked out at the latest commit of @var{branch},
+which must be a valid branch of the Git repository.
+
+@item --recursive
+@itemx -r
+Recursively clone the Git repository.
 @end table
 
 @node Invoking guix hash