From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Wingo Subject: Re: [PATCH] guix hash: -g hashes a git repository Date: Tue, 04 Apr 2017 15:57:20 +0200 Message-ID: <87k2708edb.fsf@igalia.com> References: <20170403195837.4504-1-wingo@igalia.com> <87o9wcs6qs.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvOxg-0008Ni-D0 for guix-devel@gnu.org; Tue, 04 Apr 2017 09:57:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvOxd-0005e0-6q for guix-devel@gnu.org; Tue, 04 Apr 2017 09:57:32 -0400 In-Reply-To: <87o9wcs6qs.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Tue, 04 Apr 2017 14:21:47 +0200") 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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org On Tue 04 Apr 2017 14:21, ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> +For example: >> +@example >> +$ git clone http://example.org/foo.git >> +$ guix hash -g foo >> +@end example > > In this case -g is equivalent to -rx. My main use case is when I am in a git checkout that has build products or other stuff. Then I can "guix hash -g .". Easier than making a temp dir, clone, hash, then delete. >> +Or even: >> +@example >> +$ guix hash -g http://example.org/foo.git >> +@end example >> @end table > > This one is indeed simpler. However, one typically needs to get the > commit id in addition to the hash, so it seems that in practice, most of > the time, we=E2=80=99d still need to do: > > git clone http://=E2=80=A6 > cd foo > git log | head -1 > guix hash -rx . > > so we have both the commit id and the content hash. > > WDYT? Could be! Or "git rev-parse HEAD". I'll do that. Andy