From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a1-smtp.messagingengine.com (fout-a1-smtp.messagingengine.com [103.168.172.144]) (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 61C2C267B89 for ; Tue, 11 Aug 2026 04:04:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.144 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786421077; cv=none; b=YXKRUBQyVUG+ksyzrMBz29nRz9FwjqrtHHDkcbs2SvRjaFCl4UyjURGTVa+qs6KWlIVdSDtcd/IGeLXmB63GgpT4lI9qsoTAAcv4mUdrx2UwYy8xKy3FX/OPJ2v29aP6nuGjvlrKRVb2oGwBiY2ERksrsM1nbaqQicrHkwleQQs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786421077; c=relaxed/simple; bh=8cdu7Fsjo5aKyT+1YQlT/We38NPuI2ddlvZoxZP6w9w=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=XrySFOBd75Irv6UBjryVsZb6zE5YUgzPFsyWHUhNkhMmn/HnY3N+8wkRTQ9e2UyJphqQl7jIGjaoz+K7s4pMcuunR6UF5LPqA4bYMon5+77DmVlXk/icdQVAkcRxAzDjfP0WqYn6N8z4gSpJ9pJL31zGWm+5MM32MsFlNqaJCW4= 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=dWMa+uCM; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Lx52MMIU; arc=none smtp.client-ip=103.168.172.144 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="dWMa+uCM"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Lx52MMIU" Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id 84329EC01E8; Tue, 11 Aug 2026 00:04:34 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-03.internal (MEProxy); Tue, 11 Aug 2026 00:04:34 -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=fm2; t=1786421074; x=1786507474; bh=5Uu8i2SUyI BfJYmtOKZs9ASXc+Y8AKm6nWtQCIIjpmY=; b=dWMa+uCMygxpcu0z8TRAowzJw1 28oaWn/zs3v2anaYOoo50g/Ehg0E0JpcNpQdulfHBp/n2kNbVEfkJITKYBAmz3jH dfehttad1KE71L9EY867FH9svZoN5+UnQyz/NbCGBO9voEO8V3bQI0+CPf8S06vr DLiDdbikoM7XcZipVsoAykrMkDEuj/i6ViFWliDUrUVupVt8FekmN4AM6ntEBAKN gZwXtRqgv1pedVDSfB6GAYOhcwZ93kT9TQcdNeQ+jYoactxbgl/PXNAL8XMRjSg0 gaT9N5PIYySg/zE/Nmj6WuDFBcPviFmYRjbeoKCqc5dUeUIjmjXZBjRAV0Yw== 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=fm3; t= 1786421074; x=1786507474; bh=5Uu8i2SUyIBfJYmtOK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f1YSlwZ6n55NIfBZC1iuUYoxXg X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Aug 2026 00:04:34 -0400 (EDT) From: Junio C Hamano To: git@vger.kernel.org Cc: Philippe Blain , Britton Leo Kerin , Elijah Newren , =?utf-8?Q?Rub=C3=A9n?= Justo , Patrick Steinhardt , "D. Ben Knoble" , SZEDER =?utf-8?Q?G=C3=A1bor?= Subject: Re: [PATCH 0/2] completion of 'git [-C ] checkout' In-Reply-To: (Junio C. Hamano's message of "Mon, 10 Aug 2026 20:19:32 -0700") References: Date: Mon, 10 Aug 2026 21:04:32 -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 Junio C Hamano writes: > Continuing from the previous 'git [-C ] diff' series, these two > patches correct completion for 'git checkout [-C ] path', > but without falling back to untracked paths, as "checkout paths out > of the index" is by definition about paths that appear in the index. I suppose I will add the 'untracked, too' final fallback, just like 'diff', because 'git checkout other-branch foo' could resurrect a path like 'foolish' that appears on 'other-branch' but not in the currently checked-out branch (and thus not in the index). The 'foolish' file might also appear in the working tree as an untracked path. This is not particularly useful, however, as it is unlikely that a file like 'foolish' tracked on another branch would be lying around untracked in the working tree to begin with. I did not, however, find any readily usable machinery in the 'git-completion.bash' script that allows completing a path within an arbitrary tree. If such machinery were available, 'git checkout other-branch foo' could capture the output of 'git ls-tree -r other-branch' and offer paths that begin with the given prefix. Regardless, implementing this is beyond my 'git-completion-fu' right now. As I mentioned, I barely managed the 'diff' completion as a monkey-see-monkey-do patch series, and I would welcome others building on top of this once the dust settles. > 1/2: completion: no-op refactoring of checkout completion > 2/2: completion: complete tracked paths for "git checkout" > > contrib/completion/git-completion.bash | 86 ++++++++++++++------------ > t/t9902-completion.sh | 27 ++++++++ > 2 files changed, 73 insertions(+), 40 deletions(-)