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

Re: Hyphens and hiding core commands

From
Junio C Hamano <junkio@cox.net>
Date
Nov 27, 2006, 23:59 UTC
Message-ID
<7vodqse90q.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<87bqmswm1e.wl%cworth@cworth.org>
Carl Worth <cworth@cworth.org> writes:
Show 6 quoted lines
> There's another rule-of-thumb I would like to propose that's a bit
> harder to state, but I think is just as important (if not more):
>
> 	For introductory documentation it should never make sense to
> 	introduce a command with specific command-line options before
> 	the same command without options.

I tend to disagree. "This is the easiest way to use, even for beginners" and "this way should be the default for all levels of users" are quite different.

Show 6 quoted lines
> As examples, both "commit -a" and "cat-file -p" fail that test and
> both appear in the git tutorial here:
>
> 	http://www.kernel.org/pub/software/scm/git/docs/tutorial.html
>
> My proposals to fix those two are:

Creating a "git cat" and promote that in the Tutorial makes a lot of sense, but then that can easily be done with aliases ;-). cat-file is plumbing. We did not even have '-p' and you needed to _know_ the type of stuff you are feeding and we had '-t' to help you do so. '-p' was done as a quick hack because showing the representation of any object in semi human readable way was not all that important but occasionally people found it useful, and it just was an easy thing to do inside cat-file. Nobody bothered to do a real Porcelain called "git cat" for that purpose, so far, but that is probably what should have been. On the other hand, if "cat-file -p" needs to be used often, I think there is something ELSE that is wrong.

I do not think defaulting to "commit -a" is a fix; rather, it feels exactly what Linus was talking about when he said about "second system syndrome".

I would not mind if you created "commit-easy" (just like curl library has curl_x_easy), but the current way the command works is more useful once you grok the index. Being able to work in a slightly dirty tree and commit only the necessary things, and being able to do so even for a merge commit, is damn convenient.

Because there is a learning curve involved, an easier way to use git without worrying about the index was added in the form of '-a' for beginners. People who use index regularly should not be forced to spend extra keystrokes for the rest of their lives only because you want to lose '-a' from the tutorial document. The tool should be designed for regular users, not for the first few pages of the tutorial.

Previous: Carl WorthNext: Carl Worth
Message 4 of 25 in “"init-db" can really be just "init"”
  1. "init-db" can really be just "init"Nicolas Pitre, Nov 27, 2006
  2. Junio C HamanoNov 27, 2006
  3. Hyphens and hiding core commands (was: "init-db" can really be just "init")Carl Worth, Nov 27, 2006
  4. Junio C HamanoNov 27, 2006
  5. Carl WorthNov 28, 2006
  6. Junio C HamanoNov 28, 2006
  7. Carl WorthNov 28, 2006
  8. Junio C HamanoNov 28, 2006
  9. 0/2 Making "git commit" to mean "git commit -a".Junio C Hamano, Nov 28, 2006
  10. Andy WhitcroftNov 28, 2006
  11. Josef WeidendorferNov 28, 2006
  12. Jakub NarebskiNov 28, 2006
  13. Carl WorthNov 28, 2006
  14. Salikh ZakirovNov 30, 2006
  15. Jakub NarebskiNov 30, 2006
  16. Seth FalconNov 30, 2006
  17. Nguyen Thai Ngoc DuyNov 30, 2006
  18. Seth FalconNov 30, 2006
  19. Jakub NarebskiNov 30, 2006
  20. Andy WhitcroftNov 30, 2006
  21. 1/2 git-commit: prepare to make '-a' behaviour the default.Junio C Hamano, Nov 28, 2006
  22. 2/2 git-commit: make '-a' the default.Junio C Hamano, Nov 28, 2006
  23. Jakub NarebskiNov 28, 2006
  24. Johannes SchindelinNov 27, 2006
  25. Han-Wen NienhuysNov 28, 2006

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.