git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: About --staged ang --cached

From
Jacob Keller <jacob.keller@gmail.com>
Date
Dec 10, 2025, 02:13 UTC
Message-ID
<CA+P7+xr6HHCXsiXi=CDm=rccNO4b6gmjLbuWt4KLAEwSs20aww@mail.gmail.com>
In-Reply-To
<xmqqpl8ni7bo.fsf@gitster.g>
On Tue, Dec 9, 2025 at 3:07 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
>
> Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:
>
> > Do you think that it would be relevant to add --staged to the other
> > commands just like [2] did to git-diff? Perhaps this is just a personal
> > issue, but I find it curious that those commands still have a flag named
> > after an obsolete name while newer commands are using --staged.
>
> As long as "Only in the index" aspect of the name is kept, I do not
> think the exact phrasing matters all that match.  The distinction
> between "apply --cached" vs "apply --index" must be expressable even
> if you swap "--cached" with something else.
>
> Would it be simpler to remove the label "obsoleted" from the name,
> and remove the "--staged" synonym?
>

I think it makes more sense to add a --staged synonym to commands with --cached, than to go back the other way.

Previous: Junio C Hamano
Message 3 of 3 in “About --staged ang --cached”
  1. Lucas Seiki OshiroDec 9, 2025
  2. Junio C HamanoDec 9, 2025
  3. Jacob KellerDec 10, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.