Patchwork commit: document the ui.allowemptycommit option

login
register
mail settings
Submitter Jordi Gutiérrez Hermoso
Date Dec. 30, 2015, 8:16 p.m.
Message ID <36b8f8e0a55be1e6ad33.1451506561@Iris>
Download mbox | patch
Permalink /patch/12420/
State Rejected
Headers show

Comments

Jordi Gutiérrez Hermoso - Dec. 30, 2015, 8:16 p.m.
# HG changeset patch
# User Jordi Gutiérrez Hermoso <jordigh@octave.org>
# Date 1451506458 18000
#      Wed Dec 30 15:14:18 2015 -0500
# Node ID 36b8f8e0a55be1e6ad3356d4b0177712ba62617b
# Parent  23541bdd1610c08af247f9c8719045cf247ce541
commit: document the ui.allowemptycommit option

It may be nice to document the situations in which other commands
create empty commits, but I did not think it was necessary to go into
that much detail.
timeless - Dec. 31, 2015, 3:30 p.m.
On Wed, Dec 30, 2015 at 3:16 PM, Jordi Gutiérrez Hermoso
<jordigh@octave.org> wrote:
>
> +    configuration option (see :hg:`help config`).


that should be help config.ui.allowemptycommit as in:

$ hg help config.ui.askusername
    "askusername"
        Whether to prompt for a username when committing. If True, and neither
        "$HGUSER" nor "$EMAIL" has been specified, then the user will be
        prompted to enter a username. If no username is entered, the default
        "USER@HOST" is used instead. (default: False)
Augie Fackler - Dec. 31, 2015, 4:14 p.m.
On Wed, Dec 30, 2015 at 03:16:01PM -0500, Jordi Gutiérrez Hermoso wrote:
> # HG changeset patch
> # User Jordi Gutiérrez Hermoso <jordigh@octave.org>
> # Date 1451506458 18000
> #      Wed Dec 30 15:14:18 2015 -0500
> # Node ID 36b8f8e0a55be1e6ad3356d4b0177712ba62617b
> # Parent  23541bdd1610c08af247f9c8719045cf247ce541
> commit: document the ui.allowemptycommit option

This patch needs to update localrepo.py:1604 and no longer claim
allowemptycommit is an internal config option if it's going to
document that as a public thing. I'm assuming it's not documented for
good reason...

>
> It may be nice to document the situations in which other commands
> create empty commits, but I did not think it was necessary to go into
> that much detail.
>
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -1581,6 +1581,10 @@ def commit(ui, repo, *pats, **opts):
>      commit fails, you will find a backup of your message in
>      ``.hg/last-message.txt``.
>
> +    Empty commits by default are not allowed. You may enable the
> +    creation of empty commits via the ``ui.allowemptycommit``
> +    configuration option (see :hg:`help config`).
> +
>      The --close-branch flag can be used to mark the current branch
>      head closed. When all heads of a branch are closed, the branch
>      will be considered closed and no longer listed.
> diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt
> --- a/mercurial/help/config.txt
> +++ b/mercurial/help/config.txt
> @@ -1441,6 +1441,13 @@ user or service running Mercurial.
>
>  User interface controls.
>
> +``allowemptycommit``
> +    Whether to allow creation of empty commits by the ordinary ``hg
> +    commit`` command. An empty commit is a commit that does not modify
> +    any files and is not a merge commit. Note that some other commands
> +    may still produce empty commits regardless of this setting.
> +    (default: False)
> +
>  ``archivemeta``
>      Whether to include the .hg_archival.txt file containing meta data
>      (hashes for the repository base and for tip) in archives created
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
Matt Mackall - Jan. 2, 2016, 1 a.m.
On Thu, 2015-12-31 at 11:14 -0500, Augie Fackler wrote:
> On Wed, Dec 30, 2015 at 03:16:01PM -0500, Jordi Gutiérrez Hermoso wrote:
> > # HG changeset patch
> > # User Jordi Gutiérrez Hermoso <jordigh@octave.org>
> > # Date 1451506458 18000
> > #      Wed Dec 30 15:14:18 2015 -0500
> > # Node ID 36b8f8e0a55be1e6ad3356d4b0177712ba62617b
> > # Parent  23541bdd1610c08af247f9c8719045cf247ce541
> > commit: document the ui.allowemptycommit option
> 
> This patch needs to update localrepo.py:1604 and no longer claim
> allowemptycommit is an internal config option if it's going to
> document that as a public thing. I'm assuming it's not documented for
> good reason...

..and that means we probably need check-config to complain when an undocumented
option is in fact documented.

-- 
Mathematics is the supreme nostalgia of our time.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1581,6 +1581,10 @@  def commit(ui, repo, *pats, **opts):
     commit fails, you will find a backup of your message in
     ``.hg/last-message.txt``.
 
+    Empty commits by default are not allowed. You may enable the
+    creation of empty commits via the ``ui.allowemptycommit``
+    configuration option (see :hg:`help config`).
+
     The --close-branch flag can be used to mark the current branch
     head closed. When all heads of a branch are closed, the branch
     will be considered closed and no longer listed.
diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt
--- a/mercurial/help/config.txt
+++ b/mercurial/help/config.txt
@@ -1441,6 +1441,13 @@  user or service running Mercurial.
 
 User interface controls.
 
+``allowemptycommit``
+    Whether to allow creation of empty commits by the ordinary ``hg
+    commit`` command. An empty commit is a commit that does not modify
+    any files and is not a merge commit. Note that some other commands
+    may still produce empty commits regardless of this setting.
+    (default: False)
+
 ``archivemeta``
     Whether to include the .hg_archival.txt file containing meta data
     (hashes for the repository base and for tip) in archives created