D2013: commit: allow --no-secret to override phases.new-commit setting
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Mon Feb 5 11:39:04 EST 2018
martinvonz added a comment.
In https://phab.mercurial-scm.org/D2013#33867, @martinvonz wrote:
> I wonder if we should instead have a --draft option for this. Reasons:
>
> - If we ever add a fourth phase (like Jun's proposed "archived" phase), then --no-secret doesn't clearly indicate "draft", it could just as well be "archived".
> - Actually, we of course already do have a third phase. One could imagine a "hg commit --public", although that's probably not useful enough to warrant its own option, but it seems to suggest that "--no-secret" doesn't necessarily mean "draft".
> - I find this tri-state boolean weird. "--secret" kind of defaults to off, but it can be made "more off" with "--no-secret".
I realized later that I had not considered the ordering of phases. If we did have a --draft option and the user used it on top of a secret commit, would it be surprising if it became a secret commit? That's how the phases.new-commit=draft config works, but perhaps it's more surprising when specified on the command line. OTOH, perhaps it's similarly surprising if --no-secret creates a secret commit.
INLINE COMMENTS
> test-commit.t:841-843
> + $ hg --config phases.new-commit=secret commit -qAm 'force draft' --no-secret
> + $ hg phase -r .
> + 0: draft
Might be good to have a third case where we use --no-secret on top of a secret commit (and the new commit would still be secret, I assume)
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D2013
To: spectral, #hg-reviewers
Cc: martinvonz, mercurial-devel
More information about the Mercurial-devel
mailing list