Re: Please default to 'commit -a' when no changes were added
From: Goswin von Brederlow <hidden>
Date: 2016-06-15 22:48:42
Nicolas Pitre [off-list ref] writes:
On Fri, 23 Apr 2010, Goswin von Brederlow wrote:quoted
I personaly have to work with different SCMs every day and every time I have to switch minds to work with each specific one. Making git commit work less surprising would be one less thing to keep in mind.Please make yourself some git aliases and your problem will be solved. After all, the alias mechanism was created for a reason.
I would accept an alias. But so far two people have suggested an alias for this and both have completly failed to achived the desired result. If you know of a test to check if an index exists or not, preferably one that does consider new files being added or files being removed as "index exists", then please do speak up.
quoted
You like that Git is different so don't use the --a-if-empty option. You will have lost nothing by allowing that option in. So far I have read arguments from people saying they don't want to USE the option. But no arguments why there could not be such an option. And I'm not the only one that would welcome such an option. Is there no room for a compromise?I suggest you have a look at all the examples (some are simple, some are complex) here: https://git.wiki.kernel.org/index.php/Aliases. It should be simple to make an alias with all the safety valves you might think of, and then it could even be contributed to section 7 of that page.
None of the examples have anything to do with checking for an index so that page is rather useless. I know how to set an alias. I just don't know what to put into it.
Nicolas
MfG
Goswin