Re: [PATCH 7/7] push: document --lockref
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 9, 2013, 20:37 UTC
- Message-ID
- <7vhag3v59o.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <51DC7199.2050302@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
Show 10 quoted lines
> Am 09.07.2013 21:53, schrieb Junio C Hamano: >> +--lockref:: >> +--lockref=<refname>:: >> +--lockref=<refname>:<expect>:: >> ... >> +This is meant to make `--force` safer to use. > > This is a contradiction. "--force" means "I mean it, dude", and not "I > mean it sometimes". It would make sense if this sentence were "This is > meant to make `+refspec` safer to use."
No, this *IS* making --force safer by letting you to say in addition to --force alone which is blind, add --lockref to defeat it.
I do not see any good reason to change the samentics of "+refspec" for something like this. "+refspec" and "--force refspec" have meant the same thing forever. If --lockref adds safety to +refspec, the same safety should apply to "--force refspec".
> Do you intend to require users to opt in to safety by saying --lockref > until the end of time?
For normal users this is *NOT* necessary. I do not know where people are getting the idea of making it default.
Rewinding a branch, needing to --force, is an exceptional case.
> Which makes it actually usable only for scripts > and aliases. How do you override when the safety triggers, e.g., in an > alias that uses --force --lockref?
The original request for this feature did come from script writers, who want to spin
until
git fetch &&
... magic integrate of the ongoing work ... &&
git push --lockref
do
: spin
done