From unknown Mon Jun 23 18:28:39 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#48698 <48698@debbugs.gnu.org> To: bug#48698 <48698@debbugs.gnu.org> Subject: Status: [PATCH] git-download: Fix 'git-predicate' handling of deleted files. Reply-To: bug#48698 <48698@debbugs.gnu.org> Date: Tue, 24 Jun 2025 01:28:39 +0000 retitle 48698 [PATCH] git-download: Fix 'git-predicate' handling of deleted= files. reassign 48698 guix-patches submitter 48698 Andrew Whatson severity 48698 normal tag 48698 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu May 27 10:18:19 2021 Received: (at submit) by debbugs.gnu.org; 27 May 2021 14:18:19 +0000 Received: from localhost ([127.0.0.1]:52478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmGq0-0004yW-8C for submit@debbugs.gnu.org; Thu, 27 May 2021 10:18:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:37424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmGpz-0004yP-8j for submit@debbugs.gnu.org; Thu, 27 May 2021 10:18:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmGpy-0008MF-JL for guix-patches@gnu.org; Thu, 27 May 2021 10:18:14 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:45993) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lmGpw-0000b4-SP for guix-patches@gnu.org; Thu, 27 May 2021 10:18:14 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d16so665018pfn.12 for ; Thu, 27 May 2021 07:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VvEyl9tq2PGwVwMrXDTE5Udjt28S7nZlhG0UKQwCeT4=; b=HfWVtHT+fJf+JLXmz38jvwRWi7zBURBoPFmsLLu0/6Xz8zke0Pk3u18GNwzbJxeqt+ QDtEfc99StyctkZBd9a2/JC8j4xyu4kmNvFPJY2d16Q9Yoq/LR+apmVCGmFiuAz6eaLP qpYNAZhQqSRKvlaUf/o8h1+i8hgM/LmxGXRV5jLvW+gGcQsTtuBJetIj7Yhy4CVL28/m Sx8cWLdUdDCYFpjnQ6HgM1apU+X8lj89gK1m1dotArW/hqEv5Bqq1IVy4p3y/wj54z4k KPbhjv92qbj0Ogov3i0P8OZ3cmE5XY1XfXo/o+kwgTTUxM4aFZ6SvwOe+C3rh50NnzUw ZdYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VvEyl9tq2PGwVwMrXDTE5Udjt28S7nZlhG0UKQwCeT4=; b=uQqVznVorxnZ+rlv3RUfQZfVHHwNAcXUBeCUp3i7Ho5QGQIiOhWIh8S258dnFHkNy4 3i7Kmpa8EF7OpGzUkAVRuojR1MehoQ481QKgfASc3SBGMxJJApSMEiSA2NA1v3HOPlBB tgUc9kI7sy6vVSaKf1a+D2z8bUx9/6scTcaAx54D4kTfCG1FIwTsmzejQ3NQlMUB0w3+ pG555gkpes8c5Lb2P9FFWygDQIp2Q2KCf2CGPU+PERYRCtP69OAm9Hw51wBUR+XjuowA vfPp6rcDc8tFdBuj66pcP48Xbft9kGWb4fxrYQcAWduoAFeiqga5b5Bwu31HevS7Vu4h exeg== X-Gm-Message-State: AOAM533jGA3mLkegooSnXMgp4r9o2pKne2q7mynG3oppxxc8m7qECUYn PNvHer7T2v+op1p6l6chtr6O0Rspdk0= X-Google-Smtp-Source: ABdhPJz//v30l4KkRZnGZ9Y32UvWkGk+6tz2eV93F6jel+owB6rltuh8bqQKgiOAQd6Ir9lEAxfh8w== X-Received: by 2002:aa7:9a8e:0:b029:2e7:e3fd:4fa4 with SMTP id w14-20020aa79a8e0000b02902e7e3fd4fa4mr3972455pfi.63.1622125090148; Thu, 27 May 2021 07:18:10 -0700 (PDT) Received: from muon.fritz.box ([203.221.113.127]) by smtp.gmail.com with ESMTPSA id d18sm2060648pgm.93.2021.05.27.07.18.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 May 2021 07:18:09 -0700 (PDT) From: Andrew Whatson To: guix-patches@gnu.org Subject: [PATCH] git-download: Fix 'git-predicate' handling of deleted files. Date: Fri, 28 May 2021 00:17:59 +1000 Message-Id: <20210527141759.2868127-1-whatson@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=whatson@gmail.com; helo=mail-pf1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Andrew Whatson 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: -3.3 (---) When git-predicate is used on an active worktree, some files in the index might not exist on the filesystem. Instead of failing with "No such file or directory", these should be ignored. * guix/git-download.scm (git-predicate): Skip missing files. --- guix/git-download.scm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/guix/git-download.scm b/guix/git-download.scm index 199effece5..8d8e1c865f 100644 --- a/guix/git-download.scm +++ b/guix/git-download.scm @@ -231,11 +231,13 @@ absolute file name and STAT is the result of 'lstat'." (lambda () (let* ((files (git-file-list directory)) (inodes (fold (lambda (file result) - (let ((stat - (lstat (string-append directory "/" - file)))) - (vhash-consv (stat:ino stat) (stat:dev stat) - result))) + (let* ((path (string-append directory "/" file)) + (stat (and (file-exists? path) + (lstat path)))) + (if stat + (vhash-consv (stat:ino stat) + (stat:dev stat) result) + result))) vlist-null files))) (lambda (file stat) -- 2.31.1 From debbugs-submit-bounces@debbugs.gnu.org Fri May 28 06:10:19 2021 Received: (at 48698-done) by debbugs.gnu.org; 28 May 2021 10:10:19 +0000 Received: from localhost ([127.0.0.1]:53669 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmZRb-00038e-AU for submit@debbugs.gnu.org; Fri, 28 May 2021 06:10:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmZRY-00038D-Be for 48698-done@debbugs.gnu.org; Fri, 28 May 2021 06:10:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34712) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmZRT-0005Ru-62; Fri, 28 May 2021 06:10:11 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36942 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmZRS-0003JM-U4; Fri, 28 May 2021 06:10:11 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Andrew Whatson Subject: Re: bug#48698: [PATCH] git-download: Fix 'git-predicate' handling of deleted files. References: <20210527141759.2868127-1-whatson@gmail.com> Date: Fri, 28 May 2021 12:10:09 +0200 In-Reply-To: <20210527141759.2868127-1-whatson@gmail.com> (Andrew Whatson's message of "Fri, 28 May 2021 00:17:59 +1000") Message-ID: <87v973i2ym.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48698-done Cc: 48698-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: -3.3 (---) Hi Andrew, Andrew Whatson skribis: > When git-predicate is used on an active worktree, some files in the > index might not exist on the filesystem. Instead of failing with "No > such file or directory", these should be ignored. > > * guix/git-download.scm (git-predicate): Skip missing files. I pushed a slightly different version as 50d5bb1f3e3f080212436db1b8666d061a8ae1d2, mostly avoiding the extra =E2=80=98stat=E2=80=99 call induced by =E2=80=98file-exists?=E2=80=99. Thanks, Ludo=E2=80=99. From unknown Mon Jun 23 18:28:39 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, 25 Jun 2021 11:24:10 +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