Thread (8 messages) flat view 8 messages, 6 authors, 2016-08-11

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

From: Jakub Narebski <hidden>
Date: 2016-08-11 20:20:03

Nicolas Pitre wrote:
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.
But for different reasons this alias cannot be named "commit". So you cannot
with alias make "git commit" (with -a by default) work with index. 

If "git commit -a" by default heresy ;-) was accepted, I'd rather it be via
configuration option.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help