git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* About --staged ang --cached
@ 2025-12-09 19:03 Lucas Seiki Oshiro
  2025-12-09 23:06 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Lucas Seiki Oshiro @ 2025-12-09 19:03 UTC (permalink / raw)
  To: git

Hi!

Even though the name "cache" is considered obsolete for a long time (for
example, gitglossary calls it "obsolete" since 2005 [1]), there are some
commands that still uses the flag --cached to operate on the index (e.g.
git-rm, git-grep), while newer commands (e.g., git-restore, git-stash)
use --staged. git-diff is special case where both flags exist and they
are synonyms since [2].

Personally, I'm used to type `git diff --staged` instead of `--cached`,
and my muscle memory often makes me type `git rm --staged` instead of
`git rm --cached`.

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.

Thanks!


[1] f1671ecbfa ([PATCH] Assorted changes to glossary, 2005-08-18)
[2] 2baf1850ce (git-diff: Add --staged as a synonym for --cached., 2008-10-29)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: About --staged ang --cached
  2025-12-09 19:03 About --staged ang --cached Lucas Seiki Oshiro
@ 2025-12-09 23:06 ` Junio C Hamano
  2025-12-10  2:13   ` Jacob Keller
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2025-12-09 23:06 UTC (permalink / raw)
  To: Lucas Seiki Oshiro; +Cc: git

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?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: About --staged ang --cached
  2025-12-09 23:06 ` Junio C Hamano
@ 2025-12-10  2:13   ` Jacob Keller
  0 siblings, 0 replies; 3+ messages in thread
From: Jacob Keller @ 2025-12-10  2:13 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Lucas Seiki Oshiro, git

On Tue, Dec 9, 2025 at 3:07 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-10  2:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-09 19:03 About --staged ang --cached Lucas Seiki Oshiro
2025-12-09 23:06 ` Junio C Hamano
2025-12-10  2:13   ` Jacob Keller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).