From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b4-smtp.messagingengine.com (fhigh-b4-smtp.messagingengine.com [202.12.124.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C94938B7D8 for ; Sat, 5 Sep 2026 16:14:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788624862; cv=none; b=BJzdk9WANlWSqwSF8evFZsFh4cVEmrQdZPpVHGuxv5W5PT4zL3xNxn3oYWKE+SQaqb3kT/tp2nrjLUBKckgw5snVp/uxClp+1NSjFVoQObG0ofozWt+hsT2C773vyD/wsHtP1MDTIGUvyQOYp0jZnkJ6+EadMU7JyBcjWLJWwas= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788624862; c=relaxed/simple; bh=6CoXMDPS932k46QlYZRJ4D+Oxx2RpsOR50+Jl67X9Fw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=dHC+z3oG5YP9WnZmQjWZM/PUsS1L/uoKB3PPQzR7dRXSx7H02FsUFduNs5MlJSbQbZvZBkkfNSgiJYkcuKKDm3kgc1/OBfNwnPouUT1QO8d5rYroiAdnhYGrYzypphVMI6VsF6M0bwDaIuNoXTuiEOSpHgZZEBzWqgkOzSrzxTM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b=iLBXhhrS; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=UKhe3Q4P; arc=none smtp.client-ip=202.12.124.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b="iLBXhhrS"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="UKhe3Q4P" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 0285D7A0111; Sat, 5 Sep 2026 12:14:19 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-06.internal (MEProxy); Sat, 05 Sep 2026 12:14:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1788624859; x=1788711259; bh=caCX8QJwqT /0ZYS+pfz+OXSWzHOepZwgkuePwOOk9Z4=; b=iLBXhhrSBiQc/Dj8PnCQyJW+gL qHu7P9Vs52dafNB5CwWU8VHlGvTJaFBIR5z2fNg+ZIpERvSKWyLpFKQGFfJlJUfJ gu40/TT3h3VYN8dwldZ3KJVcbTYY60MEd4k6asJXgmOv5L+CTDGGx8mZjtfw6yZy CMmWGeBLfGEObJHiV44uTYtV5/pNnnBC6LFC2hPLa0H1iRXYm7vPHKwCxPd9fQ7W LFOS9LJ+/NFfyUBUYsYYGKRQ6cN1Tg07S6SxUHUxYdnRlFM/ETTxN2KccdpN5vFw Zd857lqYtbCPgegXHmhbeIX+OcwLYFj2lT90bnBjd7igMCHolw2OaiUhUJnQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1788624859; x=1788711259; bh=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GFCum5JDfXhCsyetukoA X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 5 Sep 2026 12:14:19 -0400 (EDT) From: Junio C Hamano To: Elijah Newren Cc: Yannik Tausch , git@vger.kernel.org Subject: Re: [PATCH v2 2/2] dir: find common prefix among non-exclude pathspec items In-Reply-To: (Elijah Newren's message of "Fri, 4 Sep 2026 12:19:17 -0700") References: <81EC0E28-13E7-4D10-BD07-3601124CBD77@ytausch.de> <886A25E6-8854-4AF6-BF0B-CFB57B673026@ytausch.de> <27FF785F-F5D5-44EC-93C2-5BD67BD99147@ytausch.de> Date: Sat, 05 Sep 2026 09:14:18 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Elijah Newren writes: > Maybe I'm misreading the code. Did it always grab the first two bytes > of the element at the beginning of pathspec, or did it get an empty > string? By my reading of the code (copied here for convenience), it > got an empty string: No, I was the one who misread the code. Indeed in the loop, we assume all elements in the pathspec share the same prefix we have found to be valid so far (the loop is about shortening what we found so far with later elements in the pathspec), and blindly use the first element, which is wrong.