From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=202.12.124.144 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796517432; b=057+ueUvct6af2DUdKtfFSO1oMlyqJJSz3QHML7skYKU7PxTDsmAwUNyM0cJ34DDYttH j87pNFFQAo0yzD+kKzXKPfkPo8d8R0VIbCDzRQ74wkgOCUNzgtv/XqItGNXettzvnb+Qi p7/8c1OsMBWpPgsZ7fxHhErH2lbtuH3+DxqXGowoIBSI/9+oN8BHFC0N61mSjqDkPn3U/ JcR/C29u8ipoJtMmJzvbbYKJfU+kyptmLtPI7xCU0ddxTtDam9HNTNN0nQKvZwwkGhkcR x5gZfGpFFOLGY0mxhjuSsovpAQrX7D7oACuPWQ/1hpbD+4lzqiMko63YA+a8pGPAhNw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796517432; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: User-Agent:MIME-Version:Content-Type; bh=JmUKhkZIconsBaIejSIXDXCWemxcAno8ohHrZYpt1qA=; b=GcNyspJi0ZxhLugglamqtAvlLZGSGroCBoQ8kiWza9vpwcjFOHi3f45WkLfSj6txx57X Zrjv2o42516RJ5iE7hDD5upAr7TWxRBxzUwciOM1D0mWg0sxBsyK4bwDDcD7+pV1Wm9a2 dJuxG4bGDjqfMiMRyhT7Ler0Ls5B+WoXOJeRaLSCTg/DtalbCukLQ1WAsMx+0k83OGdMg jUb1DDnj9Yyndgh0AkmHcU5AOb1STZNMYU/1TOWOx3OlzNvXJHVHOkHQXC/mPUAKbf7PQ hqAsLO3XHsJZJ6rtoaArFmy1ExbSGvYD9+pcBQSdLrNoi7sQ8CqmKqPOJrfwPJVpICQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm3 header.b=UOwnx3+l; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=YdKvjx0B; arc=none smtp.remote-ip=202.12.124.144 Received: from fout-b1-smtp.messagingengine.com (fout-b1-smtp.messagingengine.com [202.12.124.144]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D07F606A31F for ; Sun, 6 Dec 2026 00:37:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5D07F606A31F 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, unprotected) header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm3 header.b=UOwnx3+l; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=YdKvjx0B Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id 75B731D00105 for ; Sat, 5 Dec 2026 19:37:10 -0500 (EST) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-03.internal (MEProxy); Sat, 05 Dec 2026 19:37:10 -0500 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=1796517430; x=1796603830; bh=JmUKhkZIco nsBaIejSIXDXCWemxcAno8ohHrZYpt1qA=; b=UOwnx3+lN17KEIgLXFKyU//LBf Dl5G0yBaQuz2+K+aBvREyrZVnkXFdg6EoqnEsws/hNwSlblpNP2kieNQ2RHnDFgQ I2vuDcPVI5FF1xSYPP8MU2+WmtR5xXTfu1ex5ictEZlPh5vs3hpY6BE2eAhvF8n2 hz17wH1zKR3Vqciipq6MOcSMFdPs7ZafeKYxN5s/Ljlkmr1S2mP3Jkb2znrbG0Wv PI1AKyWOrsJje/k9Vk0yMBTZWn5znRzlP8rNfns3JeevGAjxIpimIdPFx1bUPn90 bC1UmIU565clwqRbxgXpCZu9Fv+77ddP0J0WJA3gESCEs69MMFoDzTYxYwzA== 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= 1796517430; x=1796603830; bh=JmUKhkZIconsBaIejSIXDXCWemxcAno8ohH rZYpt1qA=; b=YdKvjx0BZKSYwe5S1MpaVfVqLdzK3tKUcd1w/ipQwTcIO/BAEMp S2PZkZBwL28q1n0GgzZx50moDCZcu6TbegO//MfsXP49R5DrvhGFm1sd/eUL2Nwy TLHT0xPOYkM1GArKP/a3x10AoxJIFu6eVVt2DM82i86D0LIlRFqHwu5rrhMGjSZg 9fMcvvtSkbA6v2T8vSdZau83xNKHkxFsrt6UGExdYp1c8a52tgq7ffwkjOVbC6vM OePg6ic9nV3WuGAwa3wTIZb6TdERbZxleG6JmPG5S84b7FxDPFFD7D/W2eoPAXOI T1tiPvV8GGX7stIb2mqTQGtGF4m7fXcqBYA== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=pobox.com a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796517430; d=pobox.com; mf=PGdpdHN0ZXJAcG9ib3guY29tPg==; rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+; s=fm3:rsa-sha256:gyFGZzz+ksLVucP3dxoRCAihV6eBYBpKb43ZOc847EAp4MP LvDS37xcsfIz1PdCReE5twJP1+QWY49UHcRe++cyFF7WHOnyFHoMRoE1meK86LWj KTxRrnq8wgbozGacmXzQGPStnKlezNY44OfY+gftGobJ5ZrWCxsT2zrDZ6u8uorD xScLGlqzEib0sku1jjIkeu7gnSpB3HTJXm2q75KvIQXOUwZI5Zkb9dk6aZwKfwlk 50j0Bn/KtxEn4Hh5890553bQ88/o0Z8FjjG+KBWFNoYBBrrd8YDAtcbM+a5xCijZ SylcjjibNxcSr40RdXBCsukPq045Z3bytLbBhlQ==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-type,date,feedback-id,from,in-reply-to,message-id, mime-version,references,subject,to,user-agent; Message-Instance: m=1; h=sha256:LnqItL5S0Ttk0azjx1jCltMvw5PnBbzVBG/eUr1d+hs=:0HvJzkXr6c0cO6zs5DxjDkRWp93qv8w26hr2S8G2hu0=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGF3JW0yj789gMJ28QDx/wZYJDGdYzsNKM4ns0oYAlaPIU7iEVVkTHUQfpRIopIIa ksrhVgOROJic2M2HGiRdiNfYlG81iQGVGKyFp69xiTwa9TQW/ZnIT2d904hHz21pvwma6K btW9uCjB/F3EFtMD5289j2V8ifGndtVJReqyQCMglaAI6risrAlLA7UvxCubDYdHblvig2 Rr13H5DJYsMalamyFa/+yFdgLymHaSr3qmU4TGdP4MRwRRVQmDewJPAWEyt7VCibIeqEoh uKp+WXoHIsIyXDMKKaRGhBX8VUoYNkDD/lglnc8N3JYyx7JuBpCKitttgaTYGMayXpeZJr ypbw85lmzRVBRMzE8U/sA4SB8Fjt4UtLtO5jD5plS++OVhmaUmjlKXEmnZcAuNP/TeDFLt Uhxgiid7C8bXdv5BejcJ0BOjVbllliLZKYC5VOlSaCCpfvB1pnVcIJZNCs8nkmxl+t1dUQ K6f1MTz5Gcc+dHIheOuUJQ6EqfuFP2j/yNMa4STkuhUnJ49yMXIIq7q+SUUZMIMNi3AACk WFs8ZH2pu07VnOPGWmGGglvZqp0BnDgV4P76MwGhhOSqmKQEKFNhGTeu6AY2G1zkEWGpTM te9cAHWuMCQT0a1vcbf4VA1Rkm9k/DYCdaNt5VKX2wMFkSHAmw34sqkXBQiw X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 5 Dec 2026 19:37:09 -0500 (EST) From: Junio C Hamano To: "Adam T via GitGitGadget" Cc: git@vger.kernel.org, Elijah Newren , =?utf-8?B?Tmd1eeG7hW4gVGjDoWkgTmfhu41j?= Duy , Adam T Subject: Re: [PATCH 0/2] rm: revisiting --staged and --worktree In-Reply-To: (Adam T. via GitGitGadget's message of "Sat, 05 Dec 2026 07:19:02 +0000") References: Date: Sun, 06 Dec 2026 09:37:08 +0900 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) X-Mailing-List: git@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain "Adam T via GitGitGadget" writes: > While this series only introduces the feature for rm, I generally agree > with this. It makes --worktree and --staged the standard, which reduces > the friction you'd expect while using Git. I am not sure what "friction" this reduces; adding more option names for the same thing may only add confusion. As described in the gitcli manual, '--cached' is about affecting only the index, and 'rm --cached' is exactly that. We should not deprecate '--cached' or '--index'. They are short and easy to type, and users' fingers have been trained to use them for over 20 years. However, I have no fundamental objection to introducing '--index-only' as an alias for 'rm --cached'. It would be more to type, but its meaning would be more obvious to anybody who understands how the user builds up the next commit in the index alongside the working tree files, and how the difference between the two allows the user to make progress. While 'rm --cached' tells you that it affects the index, '--index-only' improves on it by making it clear that the index is the _only_ thing it touches. Note that 'rm --staged' does not improve over 'rm --cached' on that front. For the default operation, lack of any option is sufficient, and the usual "last one wins" rule can be used to override an earlier option. $ git rm --index-only --no-index-only foo may start with "I want to remove only from the index" and then countermand it with "nono, I do not want that only-from-the-index mode in effect". This already works with '--cached' and '--no-cached' to go back to the default behavior of removing the paths from both the index and the working tree, so a separate '--index-and-working-tree' synonym may not even be needed, even though it would help those who do not yet know by default 'git rm' removes from both the index and the working tree (in other words, it would be a helpful addition only for the first two weeks of a new user's Git experience, until these users (1) stop using Git migrating to another system, (2) stop using the option, quickly learning that it is the default and forget about it, or (3) keep using the option, wasting time and keystrokes every time they want to remove tracked paths). In general, I am mildly opposed to aliases that are not really needed, as they tend to proliferate and fracture the learning experience. If we do adopt '--index-only', all subcommands that take '--cached' to operate only on the index ('apply', 'check-ignore', 'ls-files', etc.) should learn it for consistency, not just 'rm'. Also, please be careful when mentioning "worktree" and "working tree", as they are two distinct concepts. In this case, it is also doubtful that 'git rm --working-tree-only' is needed, since it is unclear what it does differently from regular 'rm'. Hope this helps establish the design perimeter better. Thanks. --- builtin/rm.c | 1 + 1 file changed, 1 insertion(+) diff --git c/builtin/rm.c w/builtin/rm.c index 081d0bc375..5804b00c0b 100644 --- c/builtin/rm.c +++ w/builtin/rm.c @@ -252,6 +252,7 @@ static struct option builtin_rm_options[] = { OPT__DRY_RUN(&show_only, N_("dry run")), OPT__QUIET(&quiet, N_("do not list removed files")), OPT_BOOL( 0 , "cached", &index_only, N_("only remove from the index")), + OPT_ALIAS(0, "index-only", "cached"), OPT__FORCE(&force, N_("override the up-to-date check"), PARSE_OPT_NOCOMPLETE), OPT_BOOL('r', NULL, &recursive, N_("allow recursive removal")), OPT_BOOL( 0 , "ignore-unmatch", &ignore_unmatch,