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

Re: [RFC/PATCH 0/2] New 'stage' command

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 7, 2009, 00:55 UTC
Message-ID
<7vfxgl46zz.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<vpqiqlh1p8t.fsf@bauges.imag.fr>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
> But that doesn't apply to "git diff". Both "git diff" and "git diff
> --cached" work with the index.

It is so often used against HEAD that it is the default for --cached mode. If it confuses your students, do not teach them "git diff --cached" without teaching "git diff --cached HEAD" first.

> ... which is everything but intuitive. The option name doesn't tell
> the user what the command is doing.

Surely, I already said that --cached vs --index are not the best words, didn't I?

But the point was that introducing STAGE and other "ref-looking tokens" not only does not help the situation at all, but makes it worse.

> I can understand the historical reasons, but I think finding a way to
> get rid of this historical terminology mess should be encourraged.
No, you should aim higher, if you are trying to change things.

Find a way to convey the concepts better, and come up with a way (i.e. set of options---as I already explained why ref looking tokens is inferiour than explicit options) that does not break the backward compatibility, and help new people learn. I am not interested in the "ref-looking tokens" because they fail the latter test.

Show 6 quoted lines
>>    - for all commands, working with work tree is the default, so there is
>>      no --work-tree option (we could add one, if you really want).
>
> Except "git checkout", which takes the index by default, and
> a commit if specified. It makes sense since checking-out from the
> working tree doesn't make sense,...

You say "except X" but you need to qualify "but that default makes sense for X". I'd say that is true for all X---so you are saying the default is sensible, which is good.

> Except "git ls-files", too....
It is a plumbing that only works with the index.  What's your problem?
> See, you complain about special cases with the proposal, but the
> current UI _has_ tons of special cases like this.

The two example you quoted above are neither tons nor special cases. And I am not saying that "ref-looking tokens are bad because there are special cases" anyway.

Previous: Matthieu MoyNext: Stefan Karpinski
Message 33 of 38 in “New 'stage' command”
  1. 0/2 New 'stage' commandFelipe Contreras, Apr 5, 2009
  2. 1/2 git: remote stageFelipe Contreras, Apr 5, 2009
  3. 2/2 Add new 'git stage' scriptFelipe Contreras, Apr 5, 2009
  4. Junio C HamanoApr 5, 2009
  5. Felipe ContrerasApr 5, 2009
  6. Junio C HamanoApr 5, 2009
  7. Junio C HamanoApr 5, 2009
  8. Felipe ContrerasApr 5, 2009
  9. Jay SoffianApr 5, 2009
  10. Felipe ContrerasApr 5, 2009
  11. 0/2 Re: New 'stage' commandNicolas Sebrecht, Apr 5, 2009
  12. Markus HeidelbergApr 5, 2009
  13. Felipe ContrerasApr 5, 2009
  14. Björn SteinbrinkApr 5, 2009
  15. Markus HeidelbergApr 5, 2009
  16. Björn SteinbrinkApr 6, 2009
  17. Markus HeidelbergApr 5, 2009
  18. Sverre RabbelierApr 5, 2009
  19. Johannes SchindelinApr 5, 2009
  20. Felipe ContrerasApr 6, 2009
  21. David AguilarApr 6, 2009
  22. Junio C HamanoApr 6, 2009
  23. David AguilarApr 6, 2009
  24. Junio C HamanoApr 6, 2009
  25. David KågedalApr 6, 2009
  26. David KågedalApr 6, 2009
  27. Junio C HamanoApr 6, 2009
  28. Felipe ContrerasApr 6, 2009
  29. Björn SteinbrinkApr 6, 2009
  30. Felipe ContrerasApr 7, 2009
  31. Johannes SchindelinApr 7, 2009
  32. Matthieu MoyApr 6, 2009
  33. Junio C HamanoApr 7, 2009
  34. Stefan KarpinskiApr 7, 2009
  35. Octavio AlvarezApr 7, 2009
  36. Junio C HamanoApr 7, 2009
  37. Octavio AlvarezApr 7, 2009
  38. Octavio AlvarezApr 7, 2009

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.