From mboxrd@z Thu Jan 1 00:00:00 1970 From: Troy Sankey Subject: Re: [PATCH] doc: clarification for hashing git checkouts Date: Mon, 11 Jul 2016 01:18:31 -0400 Message-ID: <20160711051831.15418.45217@what> References: <20160710215438.15418.98984@what> <20160710231630.GA10509@jasmine> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1902052555==" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMTcB-00048R-Jy for guix-devel@gnu.org; Mon, 11 Jul 2016 01:18:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMTc1-00063F-3M for guix-devel@gnu.org; Mon, 11 Jul 2016 01:18:38 -0400 Received: from mail-qt0-x236.google.com ([2607:f8b0:400d:c0d::236]:34576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMTc0-000638-Su for guix-devel@gnu.org; Mon, 11 Jul 2016 01:18:33 -0400 Received: by mail-qt0-x236.google.com with SMTP id u25so23801647qtb.1 for ; Sun, 10 Jul 2016 22:18:32 -0700 (PDT) In-Reply-To: <20160710231630.GA10509@jasmine> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Leo Famulari Cc: guix-devel --===============1902052555== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Quoting Leo Famulari (2016-07-10 19:16:30) > On Sun, Jul 10, 2016 at 05:54:38PM -0400, Troy Sankey wrote: > > When hashing git checkouts of packages, packagers must first remove the= .git > > directory. This commit adds this clarification to the "Invoking guix h= ash" > > page in the documentation. > = > Yes! This is one that *everybody* has to ask. I've asked it, and I've since seen two more ask on IRC :) > I think it would be better in section '5.1.2 origin reference', because > that is where the origin methods (url-fetch, git-fetch, etc) and the > sha256 field are documented. > = > In that case, it could go along with explanations of how to calculate > the hash for cvs-download, hg-download, and svn-download. > = > What do others think? I think what is really missing is a reference to 'Invoking guix hash' from '5.1.2 origin reference'. My new patch includes that reference, along with your other suggested explainations about other VCS. I think it is important that we direct people to the right tools for the job---beginning packagers should not yet be concerned about the specifics of using 'guix hash' before they learn the name of the tool. Troy --===============1902052555== Content-Type: text/x-diff; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-doc-clarification-for-hashing-git-checkouts.patch" From=2042b26d3601a6318bcefa4dfe4018daddc521e27a 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 througho= ut 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-refe= rence} 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 --===============1902052555==--