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

Re: [PATCHv3 3/4] git-status: show short sequencer state

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 14, 2012, 13:29 UTC
Message-ID
<7vy5i4b9d8.fsf@alter.siamese.dyndns.org>
In-Reply-To
<50A2DCD7.4050909@cisco.com>
Phil Hord <hordp@cisco.com> writes:
Show 5 quoted lines
>> Do you think '--tree-state' is an acceptable switch or do you have other
>> suggestions?
>
> I've been calling these 'tokens' myself.  A token is a word-or-phrase I
> can parse easily with the default $IFS, for simpler script handling.

That name may be good for variables, but it is good only because you as the implementor know what purpose the tokens are used for. Instead of having to call them with a longer name, e.g. "state tokens", only because you know that these tokens represent tree-wide (as opposed to per-file) state, you can call them "tokens" in your implementation (and in your head) without confusing yourself.

To the end users who should not care about the implementation detail, it is not a good name at all. The UI should surface the purpose, i.e. what these tokens are used for, (e.g. to represent tree-wide state) more than the fact that you happened to represent them with a single short word (i.e. "token").

So --show-tree-state, --include-tree-state-in-the-output or something along that line that tells the user what the option is about is more preferable than --token. After all, you may want to use tokens to represent different kind of information in a later topic that is not about a tree-wide state, and you will regret that you used --token for this particular feature at that time.

Previous: Phil HordNext: Phil Hord
Message 20 of 26 in “[PATCHv2] git-status: show short sequencer state”
  1. Phil HordOct 23, 2012
  2. Phil HordOct 23, 2012
  3. Jeff KingOct 25, 2012
  4. Phil HordOct 25, 2012
  5. Phil HordOct 29, 2012
  6. Jeff KingOct 29, 2012
  7. Phil HordOct 29, 2012
  8. 0/3 git-status short sequencer state infoPhil Hord, Oct 29, 2012
  9. 1/3 Refactor print_state into get_statePhil Hord, Oct 29, 2012
  10. 2/3 wt-status: More state retrieval abstractionPhil Hord, Oct 29, 2012
  11. 3/3 git-status: show short sequencer statePhil Hord, Oct 29, 2012
  12. 0/4 git-status short sequencer state infoPhil Hord, Nov 9, 2012
  13. 1/4 Refactor print_state into get_statePhil Hord, Nov 9, 2012
  14. Ramkumar RamachandraNov 12, 2012
  15. 2/4 wt-status: Teach sequencer advice to use get_statePhil Hord, Nov 9, 2012
  16. 3/4 git-status: show short sequencer statePhil Hord, Nov 9, 2012
  17. Junio C HamanoNov 12, 2012
  18. Phil HordNov 12, 2012
  19. Phil HordNov 13, 2012
  20. Junio C HamanoNov 14, 2012
  21. Phil HordNov 14, 2012
  22. Junio C HamanoNov 14, 2012
  23. Phil HordNov 14, 2012
  24. Junio C HamanoNov 14, 2012
  25. Junio C HamanoNov 14, 2012
  26. 4/4 Add tests for git-status --sequencerPhil Hord, Nov 9, 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.