Re: [PATCH 7/7] push: document --lockref
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Jul 9, 2013, 20:24 UTC
- Message-ID
- <51DC7199.2050302@kdbg.org>
- In-Reply-To
- <1373399610-8588-8-git-send-email-gitster@pobox.com>
Am 09.07.2013 21:53, schrieb Junio C Hamano:
Show 5 quoted lines
> +--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."
Do you intend to require users to opt in to safety by saying --lockref until the end of time? 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? Add --i-really-mean-it?
Or do we want to make --lockref the default at least for cases where necessary ingredients can be derived automatically, perhaps in Git 3.0? Then, how do you override when the safety triggers? Add --i-really-mean-it?
IMO, the way forward is:
1. Teach users to use +refspec to force-push. Do not encourage 'push --force'.
2. Add --lockref as an opt-in for +refspec. Do not apply the safety to 'push --force'. (Current users and scripts do not see a behavior change because they do not use --lockref, either.)
3. Make --lockref behavior the default at least for +refspec. Then 'push --force' is still able to override the safety.
-- Hannes