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 28, 2006, 00:42 UTC
Message-ID
<7vy7pwcsgp.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<87ac2cwha4.wl%cworth@cworth.org>
Carl Worth <cworth@cworth.org> writes:
Show 6 quoted lines
> Yes, there is a learning curve. There's the "once you grok the index"
> stuff you just mentioned. And it's really backwards to have to teach
> people that the "basic" way to do something is with a command line
> that looks more complex, ("commit -a"), and that "once you learn more
> you'll understand what that -a is all about and you'll know when not
> to use it".
I think you are teaching backwards.  Couldn't you start like this?
	"git commit" takes the list of paths you want to commit.
	Editing hello.c and saying "git commit hello.c" would
	commit your changes to hello.c.  It is cumbersome to
	list everything when your edit is all over the place,
	and in such a case you can say "git commit -a" to mean
	"everything I changed".

Later you can enhance that experience by teaching them index, saying:

	You might want to tell git that your change to this file
	is more or less complete, even when you are not ready to
	commit the whole thing.  You could use update-index to
	mark them and then later say "git commit" will make a
	commit from the state you used update-index on, without
	having you list them on the command line.  When you do
	this, the commit template would list three classes of
	files and here are what they mean...
Previous: Carl WorthNext: Carl Worth
Message 6 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.