From 42b26d3601a6318bcefa4dfe4018daddc521e27a Mon Sep 17 00:00:00 2001 From: Troy Sankey Date: Sun, 10 Jul 2016 17:45:55 -0400 Subject: [PATCH] doc: clarification for hashing git checkouts When hashing git checkouts of packages, packagers must first remove the .git directory. This commit adds this clarification to the "Invoking guix hash" section in the documentation, and makes a few more related changes throughout the rest of the document. --- doc/guix.texi | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index c9d9bd8..26284ac 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2425,7 +2425,7 @@ The @code{sha256} field specifies the expected SHA256 hash of the file being downloaded. It is mandatory, and allows Guix to check the integrity of the file. The @code{(base32 @dots{})} form introduces the base32 representation of the hash. You can obtain this information with -@code{guix download} (@pxref{Invoking guix download}) and @code{guix +@code{guix download} (@pxref{Invoking guix download}) or @code{guix hash} (@pxref{Invoking guix hash}). @cindex patches @@ -2684,7 +2684,9 @@ specified in the @code{uri} field as a @code{git-reference} object; a @item @code{sha256} A bytevector containing the SHA-256 hash of the source. Typically the @code{base32} form is used here to generate the bytevector from a -base-32 string. +base-32 string. You can obtain this information with @code{guix +download} (@pxref{Invoking guix download}) or @code{guix hash} +(@pxref{Invoking guix hash}). @item @code{file-name} (default: @code{#f}) The file name under which the source code should be saved. When this is @@ -4533,6 +4535,11 @@ hash (@pxref{Invoking guix archive}). @c FIXME: Replace xref above with xref to an ``Archive'' section when @c it exists. +When hashing a git checkout, be sure to remove the git configuration +directory (@code{rm -r .git}) as it will erroneously impact the hash. +The same is true for other version control checkouts (@code{rm -r .hg}, +@code{rm -r .svn}, etc.) + @end table @node Invoking guix import -- 2.1.4