Article View: linux.kernel.git
Article #1293[PATCH v4 6/7] stash create: remove unnecessary index load and refresh
From: Phillip Wood
Date: Fri, 23 Oct 2026 15:03
Date: Fri, 23 Oct 2026 15:03
29 lines
11679 bytes
11679 bytes
From: Phillip Wood <phillip.wood@dunelm.org.uk> create_index_from_tree() is called either directly or indirectly from do_create_stash() after it has loaded and refreshed the index, so we do not need to refresh it again here. This saves three lstat() calls per changed path. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> --- builtin/stash.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/builtin/stash.c b/builtin/stash.c index e17f75641a4..f97cd4771a5 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -384,9 +384,6 @@ static int create_index_from_tree(const struct object_id *tree_id, struct index_state dst_istate = INDEX_STATE_INIT(the_repository); struct lock_file lock_file = LOCK_INIT; - repo_read_index_preload(the_repository, NULL, 0); - refresh_index(the_repository->index, REFRESH_QUIET, NULL, NULL, NULL); - hold_lock_file_for_update(&lock_file, index_path, LOCK_DIE_ON_ERROR); memset(&opts, 0, sizeof(opts)); -- 2.56.0.134.g299a3c16181
Technical Details
Message-ID:
<8c54c118307cce6553929f5ff7242f85d0bbc733.1792767795.git.phillip.wood@dunelm.org.uk>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-73046-linux-kernel-git=dewy.ruReferences:
<cover.1791218125.git.phillip.wood@dunelm.org.uk> <cover.1792767794.git.phillip.wood@dunelm.org.uk>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-73046-linux-kernel-git=dewy.ru
From: phillip.wood123@gmail.com (Phillip Wood)
Newsgroups: linux.kernel.git
Subject: [PATCH v4 6/7] stash create: remove unnecessary index load and refresh
Date: Fri, 23 Oct 2026 16:03:34 +0100
Organization: Usenet Network
Message-ID: <8c54c118307cce6553929f5ff7242f85d0bbc733.1792767795.git.phillip.wood@dunelm.org.uk>
References: <cover.1791218125.git.phillip.wood@dunelm.org.uk> <cover.1792767794.git.phillip.wood@dunelm.org.uk>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="530721"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:MOUAgpR3du8ZBASydhakuU4WVy4= sha256:wUbrgt16Sk6EOwQFD2IPEzbOQC9rSzE6Ihs4wcodJT8=
sha1:Dx00FV+diy8yKDmzjdF2/RWJDcA= sha256:45yYFbExpjxjWP2HP6UDMj3n2YutsQOWHWCf8oBifrs=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 9C7191114FB; Fri, 23 Oct 2026 18:06:16 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.148
X-Spam-Status: No, score=-3.148 tagged_above=-9999 required=6.31
tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001,
HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id 1BKaZWIYJznB;
Fri, 23 Oct 2026 18:06:14 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-73046-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 6A7641114F6; Fri, 23 Oct 2026 18:06:06 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 5E64E3CCE1; Fri, 23 Oct 2026 15:03:58 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1792767836;
b=bkR15/6ltCcoTqc6fH0MC7xeK3Svp1YII6YrUpjd8c8DxDSpZ2bU27V1q20/X50PyTT/
gZ9I7H3ISn3EYPQFJVEy5vgDcckYjBUT0rTI1oCYJ74baAzfNoXaxsUmoBex05HKJVRdg
IrmklfG8NlaCLMcpaYbTLDhbHyqrb33mteL/RUy3zosTisQA8KvbHit+mZzFErG4mRudA
Lb5/jBM5k9xypJpXXL5wyciYNQ5h+L87tUUTq8OthWfSzyMKXsV+f/MUmoSMoaQozNaaR
FScD9npBt8iKOMLZ33M7hfpBVUWt1VjOraG+d98O8oLr7dZk3hCxo4AVxI2582X3UjA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792767836;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:
References:Reply-To:X-Mailing-List:List-Id:List-Post:List-Help:
List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
Content-Transfer-Encoding;
bh=PeV7UV/u1r7IiEDhNbXjPp/z6f/moa6f/wIr7LxXM0U=;
b=Vhen1sJFN8O7RcGC67pVkfnTVHpM4Q0UOmQZeBhCJwXH3PLX3nQG4w4sUVg2s7Kd7jfz
4CRLZrqxKEzCFJbgXPOA+SE4KC830vC0Kge6TwYi/B/QmasLaCaz717sTW8ZW+aXz/dgY
ZqaE54UMxPUuUp+/Sd8aQLyG3xBcmessLopYYP4GrZK9Nf2N5QzUF0I0WtfiFwVpqsp2Z
OuqP4fLrzfXoM1aqZvvouuTjPlbqL8oz50LUgHnDHjagnIiCGbK1AAfLJmzjqaW2Sa/Of
iKKCS73SEfF87L6kmx5YNu54TORFXElIpN0NWqc06tHAOGxSd0kaXECHjJ5lHEihKNg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=hJD22Kis;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E1D0606A321;
Fri, 23 Oct 2026 15:03:56 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=hJD22Kis
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.42
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1792767835;
b=tJrFaV50A9G2Oxj+h0WLzTBrlpIXs0u4HNU/BTbP3Rjm3z/GD5hlfiC275m6p7vboNCW
PZUn0uMWsGCpkQrVhj27CInVoZu+mqohjY5lf4brVi6xCs2dOzAn81lXo0J3lhtm/jiFp
N8EVTqQ54m1pUY+ZgeSpQXuoppeB7LXTUM8dQR06/oPrRsVHnieIMYg/92E+T58u07qtg
zPj/xyXvJ8+y0UF6rPKsh1YIqZT+zFSEahctJkTK9QaO95bxkS+MKQ/qPm5q0cymu9ck/
a4Wc9UnLWOu5c9LtXl7phDLjNx/uo2FJ2c77PNnJ7zo0lrZm0Kwv2CrmjsGq2a8BlGw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792767835;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
Date:Message-ID:X-Mailer:In-Reply-To:References:Reply-To:MIME-Version:
Content-Transfer-Encoding;
bh=PeV7UV/u1r7IiEDhNbXjPp/z6f/moa6f/wIr7LxXM0U=;
b=Pb4t0jU8+UjGwkh4BZgcS4CAjSfHKcKpCKpUOeNnmI3dtqgRL0kk+SvJVCIXh8dRNswt
HFVyiDwJ/iWu9eGhtb6Q1oBg4UuYyHAragaIvDjniFxsKIXZuQwiySQbYP2bvPPpGi/0t
NFpHY1O4aGDWl1xWINnBCtUuPEsKyFadR4fcakPIMJo8Q27ozv4cY+OB/A4H1XRRJKjj9
LsBrG2+X/Zo9CdtNe7TDyQSUpQ0iSgv+QlpU0TKQtZUhdrze6Dtl2KjzCUDgYefHx/Fc6
UdZZe2saC3Me9a8ShK8q/SrmPvwHK6atRS0RKOqkxFozfUFfuL92wLQO0S+v6otzm/w==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=hJD22Kis;
arc=none smtp.remote-ip=209.85.221.42
X-Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2AE61606A32F
for <git@vger.kernel.org>; Fri, 23 Oct 2026 15:03:54 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2AE61606A32F
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-48e3b22e971so359832f8f.0
for <git@vger.kernel.org>; Fri, 23 Oct 2026 08:03:54 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20251104; t=1792767833; x=1793372633; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:reply-to:references
:in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=PeV7UV/u1r7IiEDhNbXjPp/z6f/moa6f/wIr7LxXM0U=;
b=hJD22KiszXK9t8W98AG3QUo7ko0uWVfaY7ui9ckdJE6vh5m+zTaLXb6XNV7O0a8i9t
r6N4wRJt3zU7XLLzbo9Cc8TmAV3u08pfTX5B8TR2SnYaqkx73Q9w2l6RH5dlqTAj8x0z
7ks15c2JG2ngQyTKrQYqbP7TEcZLQlt72FkuK5wBwyfJemM+kX//c1Ryy3Beb68Au/UC
gNfQn2LC9mbAtrDfeox0fIjhL00yrEyz4ZMPOt4cf7ADkUdMrMMvxwIRjeXdosNDJtTj
G9RbVWxKUnayo2RKTUQDAcPEucWQD3Zqqr8Xp2IebQIIFQyqMo0azwV/4a7xkFNGI6qa
uIOA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1792767833; x=1793372633;
h=content-transfer-encoding:mime-version:reply-to:references
:in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
:x-gm-message-state:from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rJP3i+KnmqYUM2nk0
vFXVoz11RnGv6lTnD7jnEuRh0SDxiX3d0N1RfPEhW6xJVHx+S/lpiXh//M=
X-Received: by 2002:a05:6000:46c8:b0:48d:f470:6b31 with SMTP id ffacd0b85a97d-48e3859a8f4mr3004776f8f.38.1792767833460;
Fri, 23 Oct 2026 08:03:53 -0700 (PDT)
X-Received: from berwick ([2a0a:ef40:724:6601:f3ff:aebc:61f8:d91f])
by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48e3d427e68sm296326f8f.52.2026.10.23.08.03.52
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Fri, 23 Oct 2026 08:03:52 -0700 (PDT)
X-Cc: ιη°δΈθ <kazumasa.shigeta@kanamei.com>,
Phillip Wood <phillip.wood123@gmail.com>
X-Mailer: git-send-email 2.56.0.134.g299a3c16181
X-In-Reply-To: <cover.1792767794.git.phillip.wood@dunelm.org.uk>
X-Reply-To: Phillip Wood <phillip.wood@dunelm.org.uk>
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list