From unknown Sat Jun 21 10:15:08 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#22423 <22423@debbugs.gnu.org> To: bug#22423 <22423@debbugs.gnu.org> Subject: Status: git-fetch does not update checked out tree when commit hash changes Reply-To: bug#22423 <22423@debbugs.gnu.org> Date: Sat, 21 Jun 2025 17:15:08 +0000 retitle 22423 git-fetch does not update checked out tree when commit hash c= hanges reassign 22423 guix submitter 22423 Pjotr Prins severity 22423 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 21 01:54:54 2016 Received: (at submit) by debbugs.gnu.org; 21 Jan 2016 06:54:54 +0000 Received: from localhost ([127.0.0.1]:55757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aM98w-0001jI-I5 for submit@debbugs.gnu.org; Thu, 21 Jan 2016 01:54:54 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34949) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aM98v-0001j6-1Q for submit@debbugs.gnu.org; Thu, 21 Jan 2016 01:54:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aM98p-0006tN-1i for submit@debbugs.gnu.org; Thu, 21 Jan 2016 01:54:47 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aM98o-0006tJ-VR for submit@debbugs.gnu.org; Thu, 21 Jan 2016 01:54:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aM98o-0003Xz-65 for bug-guix@gnu.org; Thu, 21 Jan 2016 01:54:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aM98k-0006sK-Sn for bug-guix@gnu.org; Thu, 21 Jan 2016 01:54:46 -0500 Received: from mail.thebird.nl ([95.154.246.10]:33274) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aM98k-0006p3-Mm for bug-guix@gnu.org; Thu, 21 Jan 2016 01:54:42 -0500 Received: by mail.thebird.nl (Postfix, from userid 502) id 658E01366D2; Thu, 21 Jan 2016 07:54:03 +0100 (CET) Date: Thu, 21 Jan 2016 07:54:03 +0100 From: Pjotr Prins To: bug-guix@gnu.org Subject: git-fetch does not update checked out tree when commit hash changes Message-ID: <20160121065403.GA4278@thebird.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) I can reliably reproduce this using a recent version of GNU Guix. When updating the commit hash to a different commit the git-fetch derivation *does* change (I checked in guile), but the checked out git tree in the store does not change - it gets shared between the commits. I am not sure why the tree gets shared, but the effect is that the same package gets installed using the same /gnu/store/xxx-git-checkout. Removing the git-checkout dir and updating the Hash gives a missing dir error (as expected when they use the same). From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 21 03:50:37 2016 Received: (at 22423-done) by debbugs.gnu.org; 21 Jan 2016 08:50:37 +0000 Received: from localhost ([127.0.0.1]:55781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMAwv-0004bw-C0 for submit@debbugs.gnu.org; Thu, 21 Jan 2016 03:50:37 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53040) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMAwt-0004bi-Rb for 22423-done@debbugs.gnu.org; Thu, 21 Jan 2016 03:50:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMAwj-000808-GI for 22423-done@debbugs.gnu.org; Thu, 21 Jan 2016 03:50:30 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40594) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMAwj-000804-Ch; Thu, 21 Jan 2016 03:50:25 -0500 Received: from nat-eduroam-36-gw-01-bso.bordeaux.inria.fr ([194.199.1.36]:54550 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aMAwh-0008PF-JW; Thu, 21 Jan 2016 03:50:24 -0500 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Pjotr Prins Subject: Re: bug#22423: git-fetch does not update checked out tree when commit hash changes References: <20160121065403.GA4278@thebird.nl> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 2 =?utf-8?Q?Pluvi=C3=B4se?= an 224 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x3D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Thu, 21 Jan 2016 09:50:18 +0100 In-Reply-To: <20160121065403.GA4278@thebird.nl> (Pjotr Prins's message of "Thu, 21 Jan 2016 07:54:03 +0100") Message-ID: <87twm79v05.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 22423-done Cc: 22423-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Pjotr Prins skribis: > When updating the commit hash to a different commit the git-fetch > derivation *does* change (I checked in guile), but the checked out git > tree in the store does not change - it gets shared between the > commits. I am not sure why the tree gets shared, but the effect is > that the same package gets installed using the same > /gnu/store/xxx-git-checkout. This is expected: origins are fixed-output derivations, meaning that it does not matter how we perform them (using Git, over HTTP, or thanks to an avian carrier), as long as the result has the specified sha256. Thus, when you change, say, the Git commit ID or origin =E2=80=98method=E2= =80=99 without changing the =E2=80=98sha256=E2=80=99 field, nothing happens: the daemon sa= ys =E2=80=9COK, I already have a store item with that =E2=80=98sha256=E2=80=99, so I don=E2= =80=99t do anything.=E2=80=9D Clearly, one has to be cautious with this, it=E2=80=99s easy to mistakenly = use the old source. Hope this clarifies things! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 21 04:09:33 2016 Received: (at 22423-done) by debbugs.gnu.org; 21 Jan 2016 09:09:33 +0000 Received: from localhost ([127.0.0.1]:55788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMBFF-000563-6q for submit@debbugs.gnu.org; Thu, 21 Jan 2016 04:09:33 -0500 Received: from mail.thebird.nl ([95.154.246.10]:36812) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMBFD-00055q-G2 for 22423-done@debbugs.gnu.org; Thu, 21 Jan 2016 04:09:31 -0500 Received: by mail.thebird.nl (Postfix, from userid 502) id 6EE831366D2; Thu, 21 Jan 2016 10:08:53 +0100 (CET) Date: Thu, 21 Jan 2016 10:08:53 +0100 From: Pjotr Prins To: 22423-done@debbugs.gnu.org Subject: Re: bug#22423: git-fetch does not update checked out tree when commit hash changes Message-ID: <20160121090853.GA4914@thebird.nl> References: <20160121065403.GA4278@thebird.nl> <87twm79v05.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87twm79v05.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22423-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Thu, Jan 21, 2016 at 09:50:18AM +0100, Ludovic Courtès wrote: > This is expected: origins are fixed-output derivations, meaning that it > does not matter how we perform them (using Git, over HTTP, or thanks to > an avian carrier), as long as the result has the specified sha256. > > Thus, when you change, say, the Git commit ID or origin ‘method’ without > changing the ‘sha256’ field, nothing happens: the daemon says “OK, I > already have a store item with that ‘sha256’, so I don’t do anything.” > > Clearly, one has to be cautious with this, it’s easy to mistakenly use > the old source. Hmmm. I thought the sha256 was calculated over the derivation + sources, so any relevant change would trigger a build. Apparently it is triggered by the sha256 field only. Good to know. Pj. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 21 05:10:31 2016 Received: (at 22423-done) by debbugs.gnu.org; 21 Jan 2016 10:10:31 +0000 Received: from localhost ([127.0.0.1]:55797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMCCE-0006bZ-Q3 for submit@debbugs.gnu.org; Thu, 21 Jan 2016 05:10:31 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44715) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMCCC-0006bH-Il for 22423-done@debbugs.gnu.org; Thu, 21 Jan 2016 05:10:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMCC1-0003f5-70 for 22423-done@debbugs.gnu.org; Thu, 21 Jan 2016 05:10:22 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMCC1-0003f0-3g; Thu, 21 Jan 2016 05:10:17 -0500 Received: from pluto.bordeaux.inria.fr ([193.50.110.57]:50422 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aMCBz-0002uw-Of; Thu, 21 Jan 2016 05:10:16 -0500 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Pjotr Prins Subject: Re: bug#22423: git-fetch does not update checked out tree when commit hash changes References: <20160121065403.GA4278@thebird.nl> <87twm79v05.fsf@gnu.org> <20160121090853.GA4914@thebird.nl> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 2 =?utf-8?Q?Pluvi=C3=B4se?= an 224 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x3D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Thu, 21 Jan 2016 11:10:14 +0100 In-Reply-To: <20160121090853.GA4914@thebird.nl> (Pjotr Prins's message of "Thu, 21 Jan 2016 10:08:53 +0100") Message-ID: <87vb6n1bw9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 22423-done Cc: 22423-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Pjotr Prins skribis: > On Thu, Jan 21, 2016 at 09:50:18AM +0100, Ludovic Court=C3=A8s wrote: >> This is expected: origins are fixed-output derivations, meaning that it >> does not matter how we perform them (using Git, over HTTP, or thanks to >> an avian carrier), as long as the result has the specified sha256. >>=20 >> Thus, when you change, say, the Git commit ID or origin =E2=80=98method= =E2=80=99 without >> changing the =E2=80=98sha256=E2=80=99 field, nothing happens: the daemon= says =E2=80=9COK, I >> already have a store item with that =E2=80=98sha256=E2=80=99, so I don= =E2=80=99t do anything.=E2=80=9D >>=20 >> Clearly, one has to be cautious with this, it=E2=80=99s easy to mistaken= ly use >> the old source. > > Hmmm. I thought the sha256 was calculated over the derivation + > sources What you=E2=80=99re saying is true of the hash that appears in /gnu/store f= ile name, but I was referring to the =E2=80=98sha256=E2=80=99 field of origins,= which is a different thing. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 21 06:53:04 2016 Received: (at 22423-done) by debbugs.gnu.org; 21 Jan 2016 11:53:04 +0000 Received: from localhost ([127.0.0.1]:55863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMDnU-0000jx-Ja for submit@debbugs.gnu.org; Thu, 21 Jan 2016 06:53:04 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:35468) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <166291@gmail.com>) id 1aMDnS-0000jQ-Ks for 22423-done@debbugs.gnu.org; Thu, 21 Jan 2016 06:53:03 -0500 Received: by mail-wm0-f47.google.com with SMTP id r129so168829395wmr.0 for <22423-done@debbugs.gnu.org>; Thu, 21 Jan 2016 03:53:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=sqTCM/SoGILpxx/KWaDRMzdrAbUh68coRGiohSfL0Cs=; b=sO86zFJi3gqEyYHMspH0yiOqsx8u/6JKrJZDgJ59tXPK9vnm64p09j6vzQ7Du+RTQm XUUAiK5SyzjDkE2Mc0wE1A8tkZ5MN3TmiiKuPnSsaiyFtz8x09Fj1oyiToAMa+j7/4bn kSdN4c/oZ3S1gSsLmPoLELdrMGDPr60rbYzGKJe9X8WmFmX51uLnQzpMoWyoh/iEZB3y p2asiukIeWyZTo1wUR+jusKn4QjIgPGJCrrWRv/z4gOPOSFR3TB+qmq9qPVS40jKnvqP m/W2+MjTApim492/QotfwUtzFvz20CyLaiy9L2clUEnTRTgHppLxnDI1J8Cei6YckVFa pxHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=sqTCM/SoGILpxx/KWaDRMzdrAbUh68coRGiohSfL0Cs=; b=Lh5MMk56vsJLS/3GpvjCw0hEW+XiaUN9jVQPsIGF/6FYPSncKQMiP6oc0B340IcYls SpZxkkPzokS0ptRV87Dr7U42BdyCKx3j7BEo34ZSepTim1aIg0iE8OdCE+KxNIV9IxWU JXTxDWh+UwH8NLgJVVJQUlHL8kOcEoHo71Ms9F8JkJvb9dEV/eJzjE6laDu1rEFLHBm+ rCRwvu8v+YmjS36glq58P3ByxoIyhFpka1wU9xKoOrPJMQND4ZfJ1TWLLtyZRqStgtIk yLDqAT3oGiQRGJDqv1WQZeTXDQ1hd5u4DYduG5S+NlRl/4h0SGnbNitbNMVn5W/Hj2Xz OTEA== X-Gm-Message-State: AG10YOSDVN6cLfgUdiwp6WILjqfakfjxAaqzJI5fdlv+05AYQAA0vWSwixKdI2KH0a1rmw== X-Received: by 10.28.134.147 with SMTP id i141mr10299411wmd.87.1453377176707; Thu, 21 Jan 2016 03:52:56 -0800 (PST) Received: from localhost (tor1.malwr.org. [188.166.76.77]) by smtp.gmail.com with ESMTPSA id l194sm29717568wmb.14.2016.01.21.03.52.54 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jan 2016 03:52:56 -0800 (PST) Date: Thu, 21 Jan 2016 22:50:02 +1100 From: Jookia <166291@gmail.com> To: Ludovic =?iso-8859-1?Q?Court=E8s?= Subject: Re: bug#22423: git-fetch does not update checked out tree when commit hash changes Message-ID: <20160121115002.GA23171@novena-choice-citizen.lan> References: <20160121065403.GA4278@thebird.nl> <87twm79v05.fsf@gnu.org> <20160121090853.GA4914@thebird.nl> <87vb6n1bw9.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87vb6n1bw9.fsf@gnu.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 22423-done Cc: Pjotr Prins , 22423-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) On Thu, Jan 21, 2016 at 11:10:14AM +0100, Ludovic Courtès wrote: > Pjotr Prins skribis: > > > On Thu, Jan 21, 2016 at 09:50:18AM +0100, Ludovic Courtès wrote: > >> This is expected: origins are fixed-output derivations, meaning that it > >> does not matter how we perform them (using Git, over HTTP, or thanks to > >> an avian carrier), as long as the result has the specified sha256. > >> > >> Thus, when you change, say, the Git commit ID or origin ‘method’ without > >> changing the ‘sha256’ field, nothing happens: the daemon says “OK, I > >> already have a store item with that ‘sha256’, so I don’t do anything.” > >> > >> Clearly, one has to be cautious with this, it’s easy to mistakenly use > >> the old source. > > > > Hmmm. I thought the sha256 was calculated over the derivation + > > sources > > What you’re saying is true of the hash that appears in /gnu/store file > name, but I was referring to the ‘sha256’ field of origins, which is a > different thing. > > Ludo’. I think this is a bit of a problem even if it's expected: Often times we can't calculate the hash until it's downloaded and get a hash mismatch. The other day I rebuilt NixOS almost entirely on my machine and changed the revision on Firefox to a new branch but didn't change the hash since I expected a mismatch. Needles to say I realized what happened when I checked Firefox's version. I think it'd be great to have a 'INVALID' hash we can use for development that just prints a mismatch and errors out like usual. Maybe this is possible in Guix, but it didn't seem documented and it's not possible in NixOS. Cheers, Jookia. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 21 11:25:55 2016 Received: (at 22423-done) by debbugs.gnu.org; 21 Jan 2016 16:25:55 +0000 Received: from localhost ([127.0.0.1]:56646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMI3X-0000ji-AA for submit@debbugs.gnu.org; Thu, 21 Jan 2016 11:25:55 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47719) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMI3V-0000jW-Ct for 22423-done@debbugs.gnu.org; Thu, 21 Jan 2016 11:25:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMI3M-0000oM-RJ for 22423-done@debbugs.gnu.org; Thu, 21 Jan 2016 11:25:48 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMI3M-0000oI-NS; Thu, 21 Jan 2016 11:25:44 -0500 Received: from pluto.bordeaux.inria.fr ([193.50.110.57]:54666 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aMI3L-0001Dw-8C; Thu, 21 Jan 2016 11:25:44 -0500 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Jookia <166291@gmail.com> Subject: Re: bug#22423: git-fetch does not update checked out tree when commit hash changes References: <20160121065403.GA4278@thebird.nl> <87twm79v05.fsf@gnu.org> <20160121090853.GA4914@thebird.nl> <87vb6n1bw9.fsf@gnu.org> <20160121115002.GA23171@novena-choice-citizen.lan> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 2 =?utf-8?Q?Pluvi=C3=B4se?= an 224 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x3D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Thu, 21 Jan 2016 17:25:40 +0100 In-Reply-To: <20160121115002.GA23171@novena-choice-citizen.lan> (Jookia's message of "Thu, 21 Jan 2016 22:50:02 +1100") Message-ID: <87vb6mzypn.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 22423-done Cc: Pjotr Prins , 22423-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Jookia <166291@gmail.com> skribis: > On Thu, Jan 21, 2016 at 11:10:14AM +0100, Ludovic Court=C3=A8s wrote: >> Pjotr Prins skribis: >>=20 >> > On Thu, Jan 21, 2016 at 09:50:18AM +0100, Ludovic Court=C3=A8s wrote: >> >> This is expected: origins are fixed-output derivations, meaning that = it >> >> does not matter how we perform them (using Git, over HTTP, or thanks = to >> >> an avian carrier), as long as the result has the specified sha256. >> >>=20 >> >> Thus, when you change, say, the Git commit ID or origin =E2=80=98meth= od=E2=80=99 without >> >> changing the =E2=80=98sha256=E2=80=99 field, nothing happens: the dae= mon says =E2=80=9COK, I >> >> already have a store item with that =E2=80=98sha256=E2=80=99, so I do= n=E2=80=99t do anything.=E2=80=9D >> >>=20 >> >> Clearly, one has to be cautious with this, it=E2=80=99s easy to mista= kenly use >> >> the old source. >> > >> > Hmmm. I thought the sha256 was calculated over the derivation + >> > sources >>=20 >> What you=E2=80=99re saying is true of the hash that appears in /gnu/stor= e file >> name, but I was referring to the =E2=80=98sha256=E2=80=99 field of origi= ns, which is a >> different thing. >>=20 >> Ludo=E2=80=99. > > I think this is a bit of a problem even if it's expected: Often times we = can't > calculate the hash until it's downloaded and get a hash mismatch. The oth= er day > I rebuilt NixOS almost entirely on my machine and changed the revision on > Firefox to a new branch but didn't change the hash since I expected a mis= match. > > Needles to say I realized what happened when I checked Firefox's version.= I > think it'd be great to have a 'INVALID' hash we can use for development t= hat > just prints a mismatch and errors out like usual. Maybe this is possible = in > Guix, but it didn't seem documented and it's not possible in NixOS. The problem is that Guix cannot guess that the =E2=80=98sha256=E2=80=99 the= developer provided in the =E2=80=98origin=E2=80=99 form is actually wrong. Only the = developer knows. This is mitigated in Guix by the fact that we usually include the version string or Git commit ID in the origin=E2=80=99s file name, with pat= terns like: (define foo (let ((commit "deadbeef")) (package (name "foo") (version commit) (source (origin (method git-fetch) (uri (git-reference (commit commit) =E2=80=A6)) (file-name (string-append name "-" commit)) ;<=E2=80=93 ! (sha256 =E2=80=A6) =E2=80=A6)) =E2=80=A6))) The good thing with this pattern is that, when you modify the value of =E2=80=98commit=E2=80=99, you also end up modifying =E2=80=98file-name=E2= =80=99, thus triggering a re-download. So if you had forgotten to update =E2=80=98sha256=E2=80=99, y= ou immediately get a hash mismatch error. In practice, I=E2=80=99ve found this to be rather helpful. Additionally, =E2=80=98guix lint=E2=80=99 emits warnings for packages that = do not follow this pattern, hopefully making the problem that Pjotr describes less likely. Ludo=E2=80=99. From unknown Sat Jun 21 10:15:08 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 19 Feb 2016 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator