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

Re: [PATCH 0/2] Making "git commit" to mean "git commit -a".

From
Nicolas Pitre <nico@cam.org>
Date
Nov 29, 2006, 18:08 UTC
Message-ID
<Pine.LNX.4.64.0611291234350.9647@xanadu.home>
In-Reply-To
<7vr6vmsnly.fsf@assigned-by-dhcp.cox.net>
On Tue, 28 Nov 2006, Junio C Hamano wrote:
Show 10 quoted lines
> Nicolas Pitre <nico@cam.org> writes:
> 
> > This argument has its converse.  What you should _not_ have to worry 
> > about all the time is whether your index really includes all the changes 
> > you want included in your next commit.
> 
> That's what we have "git diff" with various output options for;
> I often do "git diff --stat" or "git diff --name-status" when I
> know I am about to commit in a dirty working tree.  I suspect
> that I am not getting your point.
I'm afraid this conversation is getting nowhere then.
Show 6 quoted lines
> > And whether wanting to leave local changes in the working directory 
> > without commiting them actually happen more often than wanting to commit 
> > every changes is arguable.
> 
> I do not think anybody is talking about which happens more
> often.
But I do.
Show 6 quoted lines
> "screw the index" people do not have to worry about the
> index during the course of their changes in the working tree
> toward the next commit, and the only time they need to tell git
> (which _IS_ a system based on the index, dammit) about what they
> want to do with the index is at the commit time, and they tell
> git to "screw the index" by passing "-a" to "git commit".

No one talked about "screw the index" people. Those are happily using Cogito.

We're talking about flattening the GIT learning curve. And as futile it may seem to you that newbies should just use "commit -a" without thinking, they still get bothered by that -a there. And probably they'll forget about it once in a while and then GIT will _appear_ as malfunctioning to them.

Of course amongst those newbies that didn't went away at this point there will be those who decide to study further and come to the index concept. And I hope that we all agree that the index is a powerful but still advanced concept that should not be presented up front.

But my point is: why not making a very little change to the default commit behavior. Really little change involving -a being the default. The impact on newbies will be significant as they won't have to grok everything at once to make sense of this -a we are telling them to use blindly. And it will sort of match known expectations to commit everything dirty.

And actually my point above is that in many cases, maybe the majoryty of those case but this is arguable, what one is doing is not keeping dirty and uncommited state around but rather committing every changes all the time. In _that_ case, which might not be all the time but often enough, then using -a is annoying[1].

So having -a the default makes GIT much more friendly to new users. You "add" files, you "commit", you edit some files, you "commit" again, and everything works fine, and you are happy and starts feeling good about GIT.

Now for those who've seen the light and want to use the index it is not much of a bother to add a -i to their commit invokation. At this point if you understand the index you know what you're doing, and using -i won't bother you as much it bothered you to use -a without knowing why when you was a newbie.

But still, if you are a GIT old fart and have difficulties switching habits, or if you simply are the kind with dirty not-to-commit state in your tree and adding -i all the time bothers you just like [1] above, then there is a way out! You are a GIT expert at this point of course and certainly know how to add an alias for the -i to be implicit with your "commit".

Therefore I think this is much more logical to ask the experts to add an alias for "commit -i" than asking such tricks from less experienced users. This is all my point is about.

Previous: Junio C HamanoNext: Jakub Narebski
Message 4 of 76 in “Re: [PATCH 0/2] Making "git commit" to mean "git commit -a".”
  1. Junio C HamanoNov 29, 2006
  2. Nicolas PitreNov 29, 2006
  3. Junio C HamanoNov 29, 2006
  4. Nicolas PitreNov 29, 2006
  5. Jakub NarebskiNov 29, 2006
  6. Steven GrimmNov 29, 2006
  7. Jakub NarebskiNov 29, 2006
  8. Junio C HamanoNov 29, 2006
  9. Steven GrimmNov 29, 2006
  10. Johannes SchindelinNov 29, 2006
  11. Junio C HamanoNov 29, 2006
  12. xdl_merge(), was Re: [PATCH 0/2] Making "git commit" to mean "git commit -a".Johannes Schindelin, Nov 29, 2006
  13. Seth FalconNov 30, 2006
  14. Carl WorthNov 29, 2006
  15. Johannes SchindelinNov 29, 2006
  16. Junio C HamanoNov 30, 2006
  17. Junio C HamanoNov 30, 2006
  18. Steven GrimmNov 30, 2006
  19. Sam VilainNov 30, 2006
  20. Junio C HamanoNov 30, 2006
  21. Johannes SchindelinNov 30, 2006
  22. Linus TorvaldsNov 30, 2006
  23. Johannes SchindelinNov 30, 2006
  24. Andreas EricssonNov 30, 2006
  25. Linus TorvaldsNov 30, 2006
  26. Theodore TsoNov 30, 2006
  27. Linus TorvaldsNov 30, 2006
  28. Nicolas PitreNov 30, 2006
  29. Carl WorthNov 30, 2006
  30. Jakub NarebskiNov 30, 2006
  31. Carl WorthNov 30, 2006
  32. Andreas EricssonDec 1, 2006
  33. Han-Wen NienhuysDec 1, 2006
  34. Carl WorthNov 30, 2006
  35. Linus TorvaldsNov 30, 2006
  36. Nicolas PitreNov 30, 2006
  37. Linus TorvaldsNov 30, 2006
  38. Jakub NarebskiNov 30, 2006
  39. Carl WorthNov 30, 2006
  40. Michael K. EdwardsNov 30, 2006
  41. Carl WorthNov 30, 2006
  42. Jakub NarebskiNov 30, 2006
  43. Johannes SchindelinNov 30, 2006
  44. Josef WeidendorferNov 30, 2006
  45. Johannes SchindelinNov 30, 2006
  46. Nicolas PitreNov 30, 2006
  47. Nicolas PitreNov 30, 2006
  48. Junio C HamanoNov 30, 2006
  49. Andy ParkinsDec 1, 2006
  50. Alan ChandlerDec 1, 2006
  51. Junio C HamanoNov 30, 2006
  52. Nicolas PitreNov 30, 2006
  53. Junio C HamanoNov 30, 2006
  54. Linus TorvaldsNov 30, 2006
  55. Carl WorthDec 1, 2006
  56. Linus TorvaldsDec 1, 2006
  57. Carl WorthDec 1, 2006
  58. Linus TorvaldsDec 1, 2006
  59. Carl WorthDec 1, 2006
  60. Linus TorvaldsDec 1, 2006
  61. Carl WorthDec 1, 2006
  62. Michael K. EdwardsDec 1, 2006
  63. Junio C HamanoDec 1, 2006
  64. Jakub NarebskiDec 1, 2006
  65. Nicolas PitreDec 1, 2006
  66. Andreas EricssonDec 1, 2006
  67. Alan ChandlerDec 1, 2006
  68. Robert ShearmanNov 30, 2006
  69. Jakub NarebskiNov 30, 2006
  70. Shawn PearceDec 1, 2006
  71. Marco CostalbaDec 2, 2006
  72. Carl WorthNov 30, 2006
  73. Linus TorvaldsNov 30, 2006
  74. Daniel BarkalowNov 30, 2006
  75. Nicolas PitreNov 30, 2006
  76. Johannes SchindelinNov 30, 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.