Re: 'commit -a' safety
- From
Miles Bader <miles@gnu.org>
- Date
- Apr 24, 2010, 09:56 UTC
- Message-ID
- <87fx2li36m.fsf@catnip.gol.com>
- In-Reply-To
- <m3633hdw9u.fsf_-_@localhost.localdomain>
Jakub Narebski <jnareb@gmail.com> writes:
Show 9 quoted lines
> 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.