From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b8-smtp.messagingengine.com (fout-b8-smtp.messagingengine.com [202.12.124.151]) (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 9FB1F36F411 for ; Mon, 3 Aug 2026 13:41:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785764516; cv=none; b=HeBt92T+XbRm3/SNapciyTvviKaCDfQlNYlumvXafVwqdkNYposRBOJ9jgSyyqAZ1LishocPa/4KbdPLp0Qn2K60nXt7l4mhczhkiGiAa4HbZdS7NUL+p312NeZGZdrwphtH8TW0fZDYw75ATgAMmyKRw4/5SBPc5Kn4wxAOwIo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785764516; c=relaxed/simple; bh=3RIxY5rDFuE4zQ8ek56JBgqU9YMUjtYyBHQh+KT3+vE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=TsC/b7adHN0/4bZR9FNtNJUr2FDT2NSqZkrzCzOs8V3DLr5NZkznmloqrayaYgpUuQYvw9pZiNaVshgRaEwmzsQxTOACuhjvLFnpEMnfGRP1GF1uiVDeUkdmn3+VcDzIMj8fOGQ0tK/XALJlo59EapQkAcx2kF7+3O+KNlBquLI= 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=gfQxvVAg; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=aZy6FTNE; arc=none smtp.client-ip=202.12.124.151 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="gfQxvVAg"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="aZy6FTNE" Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id AB6351D0004C; Mon, 3 Aug 2026 09:41:53 -0400 (EDT) Received: from phl-frontend-01 ([10.202.2.160]) by phl-compute-02.internal (MEProxy); Mon, 03 Aug 2026 09:41:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :cc:content-transfer-encoding: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=1785764513; x=1785850913; bh=A/Q886mQ4DdjooRjwBeZpTkeujDuv/0ZlNHyXtBo8+Y=; b= gfQxvVAgMm9501uDVnFjBrBY7PuqnsfD5ycmq8JJ+FIghGdIuaBygVrijAGQ0jrP nQ8AueuWMggYREuApxccrmeWFzrm2Xy0t0FmJVeAKqsjjJqOk2yLzDLRZ7yqf/ZG mqSpusJTy2CNWhkDQUOKycd8yKbxo2ZzlO9oEPSNI3yzNenQ20tiD1kO/IwpYdhi 8Gza4Op8hlJ2BXIBQ7T0WbfZvYVTITFKD8lrIrWbyISwjBm1HkCEmLR+CrDJvWjh cqjAuqvuvg/honf2Ze+QxaJ+ukSSDAEsUhWbo4PpRP6NWpWN4TprasUGfemDVKSF /5uC6htuW24np3BjCepdiQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=1785764513; x= 1785850913;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7hCT59EPldj6vsNMw3gU/vthX3Hwl9JwqqbqGIDGFalrrdA X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 3 Aug 2026 09:41:52 -0400 (EDT) From: Junio C Hamano To: SZEDER =?utf-8?Q?G=C3=A1bor?= Cc: git@vger.kernel.org, Philippe Blain , Britton Leo Kerin , Elijah Newren , =?utf-8?Q?Rub=C3=A9n?= Justo , Patrick Steinhardt Subject: Re: [PATCH] completion: complete tracked paths for 'git diff' In-Reply-To: ("SZEDER =?utf-8?Q?G=C3=A1bor?= =?utf-8?Q?=22's?= message of "Mon, 3 Aug 2026 07:44:25 +0200") References: Date: Mon, 03 Aug 2026 06:41:51 -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; charset=utf-8 Content-Transfer-Encoding: 8bit SZEDER Gábor writes: > I think we should check whether the '--no-index' option is present on > the command line, and simply not call __git_complete_index_file() if > it is, to let Bash list all paths; i.e. each of those calls should be > protected by an additional 'if test -z "$(__git_find_on_cmdline > "--no-index")' condition, perhaps. Ah, I did not think of the "we made 'git diff' work without Git" mode at all. But I would avoid scanning the command line for '--no-index' for two reasons: (1) "git diff -S --no-index maint master" would not give you the '--no-index' mode. (2) When run outside the working tree of a repository, you do not have to say '--no-index'. These make detecting the "'git diff' but not Git" mode tedious and error-prone. I have not tried this, but if we arranged the code to fall back further to Bash-native "paths in $PWD" after the completion code in the posted patch found nothing, would it be sufficient? When trying to complete an untracked file in the working tree of a repository, if the file shares the same prefix with a tracked file, you cannot complete the untracked file without a prefix long enough to disambiguate it from the tracked one. Such a prefix may not even exist (e.g., 'foo' is tracked and 'foo~' is untracked; when you type "git diff --no-index foo", you get 'foo' but not 'foo~', so you end up typing 'foo~' in full). In that sense, it is a regression, but supporting Git usage is the primary mission of 'git diff', so the trade-off may not be so bad. Thoughts?