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

Re: [1.8.0] use 'stage' term consistently

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 20, 2012, 12:04 UTC
Message-ID
<CAMP44s2bbJLgqOdi49jS34E79EvNtRifpCbDE_bQUys+3xrs3w@mail.gmail.com>
In-Reply-To
<20120519063208.GA24556@burratino>
On Sat, May 19, 2012 at 8:32 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 19 quoted lines
> Jonathan Nieder wrote:
>
>> For the sake of having a proposal: :)
>
> For the command-line interface:
>
> Making the "git stage" command more prominent.  Unfortunately it is
> currently a synonym for "git add", which makes "git rm" less
> discoverable and generally isn't very helpful.  But if we discard that
> property, it could become a nice way to make some operations more
> discoverable:
>
>        git stage --add <paths>; # stage an addition
>        git stage --remove <paths>; # stage a removal
>        git stage --edit <paths>; # edit the staged content
>        git stage --apply <patch>; # stage the described change
>
> These would be commands that modify the index without touching the
> worktree.
If they are commands, why do they start with --?

'git stage add' 'git stage remove' 'git stage edit'

Would be more appropriate.
But I think revamping 'git stage' should be a separate task.
Show 16 quoted lines
> Finding a better mnemonic than "also update the current directory cache"
> and "trust the current directory cache" for operations like git apply
> --index and git grep --cached.  Better concepts would be "search the
> content staged for the next commit" and "also update the staged
> content".
>
> Maybe:
>
>        git apply --index=(yes | no | only)
>                # apply                 = apply --index=no
>                # apply --index         = apply --index=yes
>                # apply --cached        = apply --index=only
>
>        git grep --index; # (= git grep --cached)
>
> I imagine others can come up with something better.

'index'? That goes contrary to this request; the term 'index' should be avoided in porcelain commands. s/index/stage/ and the proposal seems sensible, but I fail to see how --stage=no could be helpful, and --stage=yes should be the same as --stage, and then I wonder what would be the purpose of having --stage, and --stage=only, where we could have a --stage(d)-only for commands that need this distinction (not all of them). If in the future we want more --stage=foo options, then it might make sense, but I just don't see that ever happening.

I guess the next step would be to list all the commands that use --index, --staged, and --cached, and propose new options that would eventually help to remove --index and --cached (after some period of deprecation).

Cheers.
-- 
Felipe Contreras
Previous: Jonathan NiederNext: Jonathan Nieder
Message 25 of 34 in “[1.8.0] use 'stage' term consistently”
  1. Felipe ContrerasMay 5, 2012
  2. Philip OakleyMay 5, 2012
  3. Felipe ContrerasMay 5, 2012
  4. Philip OakleyMay 5, 2012
  5. Zbigniew Jędrzejewski-SzmekMay 6, 2012
  6. Jakub NarebskiMay 6, 2012
  7. Matthieu MoyMay 6, 2012
  8. Felipe ContrerasMay 6, 2012
  9. Jakub NarebskiMay 6, 2012
  10. Junio C HamanoMay 8, 2012
  11. Felipe ContrerasMay 6, 2012
  12. Matthieu MoyMay 6, 2012
  13. Felipe ContrerasMay 6, 2012
  14. Ævar Arnfjörð BjarmasonMay 6, 2012
  15. Junio C HamanoMay 7, 2012
  16. Ævar Arnfjörð BjarmasonMay 7, 2012
  17. Junio C HamanoMay 8, 2012
  18. Ævar Arnfjörð BjarmasonMay 8, 2012
  19. Junio C HamanoMay 8, 2012
  20. Felipe ContrerasMay 9, 2012
  21. Matthieu MoyMay 9, 2012
  22. Mark LodatoMay 19, 2012
  23. Jonathan NiederMay 19, 2012
  24. Jonathan NiederMay 19, 2012
  25. Felipe ContrerasMay 20, 2012
  26. Jonathan NiederMay 20, 2012
  27. Philip OakleyMay 19, 2012
  28. Felipe ContrerasMay 20, 2012
  29. Jonathan NiederMay 20, 2012
  30. Junio C HamanoMay 20, 2012
  31. Felipe ContrerasMay 21, 2012
  32. Jonathan NiederMay 21, 2012
  33. Thiago FarinaMay 18, 2012
  34. Sebastien DoucheMay 8, 2012

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.