Re: 'commit -a' safety

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jakub Narebski <jnareb@xxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]