Subject: Re: 'commit -a' safety

From: Miles Bader <[email-masked]>
Date: Sat, 24 Apr 2010 18:56:49 +0900

Jakub Narebski <[email-masked]> writes:
> I'd like for 'git commit -a' to *fail* if there are staged changes for
> tracked files, excluding added, removed and renamed files.  If you
> have some staged changes you would get an error message:
>
>   $ git add tracked-file
>   $ git commit -a
>   fatal: There are staged changes to tracked files
>   hint: To commit staged changes, use 'git commit'
>   hint: To commit all changes, use 'git commit -f -a' 

That's bad because of the dual nature of "git add" -- someone may
normally use "-a" most of the time to commit changes, but has really no
choice other than git add to add a new file, So with this change, their
normal (and reasonable) habits would suddenly result in failure.

I think it's sort of annoying that "git add" has such a dual meaning
(instead of, for instance, having separate "add" and "stage" commands)
-- it's one of the more confusing things about learning about git
-- but oh well, it's unlikely to get changed at this point....

-Miles

-- 
Defenceless, adj. Unable to attack.