[v4,01/19] git-rebase.txt: update description of --allow-empty-message
diff mbox series

Message ID 3ea48d53940cb7e1a82a8a6eb819497c0448af6a.1579155273.git.gitgitgadget@gmail.com
State New
Headers show
Series
  • rebase: make the default backend configurable
Related show

Commit Message

Hariom Verma via GitGitGadget Jan. 16, 2020, 6:14 a.m. UTC
From: Elijah Newren <newren@gmail.com>

Commit b00bf1c9a8dd ("git-rebase: make --allow-empty-message the
default", 2018-06-27) made --allow-empty-message the default and thus
turned --allow-empty-message into a no-op but did not update the
documentation to reflect this.  Update the documentation now, and hide
the option from the normal -h output since it is not useful.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 Documentation/git-rebase.txt |  7 ++++---
 builtin/rebase.c             | 12 +++++++-----
 2 files changed, 11 insertions(+), 8 deletions(-)

Comments

Phillip Wood Feb. 9, 2020, 3:59 p.m. UTC | #1
Hi Elijah

On 16/01/2020 06:14, Elijah Newren via GitGitGadget wrote:
> From: Elijah Newren <newren@gmail.com>
> 
> Commit b00bf1c9a8dd ("git-rebase: make --allow-empty-message the
> default", 2018-06-27) made --allow-empty-message the default and thus
> turned --allow-empty-message into a no-op but did not update the
> documentation to reflect this.  Update the documentation now, and hide
> the option from the normal -h output since it is not useful.
> 
> Signed-off-by: Elijah Newren <newren@gmail.com>
> ---
>   Documentation/git-rebase.txt |  7 ++++---
>   builtin/rebase.c             | 12 +++++++-----
>   2 files changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
> index 0c4f038dd6..c83be7ffc2 100644
> --- a/Documentation/git-rebase.txt
> +++ b/Documentation/git-rebase.txt
> @@ -265,9 +265,10 @@ See also INCOMPATIBLE OPTIONS below.
>   See also INCOMPATIBLE OPTIONS below.
>   
>   --allow-empty-message::
> -	By default, rebasing commits with an empty message will fail.
> -	This option overrides that behavior, allowing commits with empty
> -	messages to be rebased.
> +	No-op.  Rebasing commits with an empty message used to fail
> +	and this option would override that behavior, allowing commits
> +	with empty messages to be rebased.  Now commits with an empty
> +	message do not cause rebasing to halt.

Do we want to mention that the user can pass --no-allow-empty-message to 
override this?

Best Wishes

Phillip

>   +
>   See also INCOMPATIBLE OPTIONS below.
>   
> diff --git a/builtin/rebase.c b/builtin/rebase.c
> index 8081741f8a..faa4e0d406 100644
> --- a/builtin/rebase.c
> +++ b/builtin/rebase.c
> @@ -453,8 +453,9 @@ int cmd_rebase__interactive(int argc, const char **argv, const char *prefix)
>   		OPT_NEGBIT(0, "ff", &opts.flags, N_("allow fast-forward"),
>   			   REBASE_FORCE),
>   		OPT_BOOL(0, "keep-empty", &opts.keep_empty, N_("keep empty commits")),
> -		OPT_BOOL(0, "allow-empty-message", &opts.allow_empty_message,
> -			 N_("allow commits with empty messages")),
> +		OPT_BOOL_F(0, "allow-empty-message", &opts.allow_empty_message,
> +			   N_("allow commits with empty messages"),
> +			   PARSE_OPT_HIDDEN),
>   		OPT_BOOL(0, "rebase-merges", &opts.rebase_merges, N_("rebase merge commits")),
>   		OPT_BOOL(0, "rebase-cousins", &opts.rebase_cousins,
>   			 N_("keep original branch points of cousins")),
> @@ -1495,9 +1496,10 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
>   		OPT_STRING_LIST('x', "exec", &exec, N_("exec"),
>   				N_("add exec lines after each commit of the "
>   				   "editable list")),
> -		OPT_BOOL(0, "allow-empty-message",
> -			 &options.allow_empty_message,
> -			 N_("allow rebasing commits with empty messages")),
> +		OPT_BOOL_F(0, "allow-empty-message",
> +			   &options.allow_empty_message,
> +			   N_("allow rebasing commits with empty messages"),
> +			   PARSE_OPT_HIDDEN),
>   		{OPTION_STRING, 'r', "rebase-merges", &rebase_merges,
>   			N_("mode"),
>   			N_("try to rebase merges instead of skipping them"),
>
Elijah Newren Feb. 13, 2020, 6:35 p.m. UTC | #2
Hi Phillip,

On Sun, Feb 9, 2020 at 7:59 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
>
> Hi Elijah
>
...
> > diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
> > index 0c4f038dd6..c83be7ffc2 100644
> > --- a/Documentation/git-rebase.txt
> > +++ b/Documentation/git-rebase.txt
> > @@ -265,9 +265,10 @@ See also INCOMPATIBLE OPTIONS below.
> >   See also INCOMPATIBLE OPTIONS below.
> >
> >   --allow-empty-message::
> > -     By default, rebasing commits with an empty message will fail.
> > -     This option overrides that behavior, allowing commits with empty
> > -     messages to be rebased.
> > +     No-op.  Rebasing commits with an empty message used to fail
> > +     and this option would override that behavior, allowing commits
> > +     with empty messages to be rebased.  Now commits with an empty
> > +     message do not cause rebasing to halt.
>
> Do we want to mention that the user can pass --no-allow-empty-message to
> override this?

Interesting point.  I could be persuaded towards that, but I'm leaning
against it based on the logic in b00bf1c9a8dd which this commit was
based upon.

However, even if we do want to mention --no-allow-empty-message, I'd
rather do that in a different series.  This patch is already slightly
tangential to the series, but it at least fixes the documentation for
a previously-documented option -- an option that happens to be similar
in spirit to the ones being touched by the series.  Adding
documentation for a previously undocumented option, while possibly
laudable, feels like taking a tangent to a tangent to me.  (And this
series is already long enough and is still hanging after two months,
so...)


Elijah

Patch
diff mbox series

diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 0c4f038dd6..c83be7ffc2 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -265,9 +265,10 @@  See also INCOMPATIBLE OPTIONS below.
 See also INCOMPATIBLE OPTIONS below.
 
 --allow-empty-message::
-	By default, rebasing commits with an empty message will fail.
-	This option overrides that behavior, allowing commits with empty
-	messages to be rebased.
+	No-op.  Rebasing commits with an empty message used to fail
+	and this option would override that behavior, allowing commits
+	with empty messages to be rebased.  Now commits with an empty
+	message do not cause rebasing to halt.
 +
 See also INCOMPATIBLE OPTIONS below.
 
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 8081741f8a..faa4e0d406 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -453,8 +453,9 @@  int cmd_rebase__interactive(int argc, const char **argv, const char *prefix)
 		OPT_NEGBIT(0, "ff", &opts.flags, N_("allow fast-forward"),
 			   REBASE_FORCE),
 		OPT_BOOL(0, "keep-empty", &opts.keep_empty, N_("keep empty commits")),
-		OPT_BOOL(0, "allow-empty-message", &opts.allow_empty_message,
-			 N_("allow commits with empty messages")),
+		OPT_BOOL_F(0, "allow-empty-message", &opts.allow_empty_message,
+			   N_("allow commits with empty messages"),
+			   PARSE_OPT_HIDDEN),
 		OPT_BOOL(0, "rebase-merges", &opts.rebase_merges, N_("rebase merge commits")),
 		OPT_BOOL(0, "rebase-cousins", &opts.rebase_cousins,
 			 N_("keep original branch points of cousins")),
@@ -1495,9 +1496,10 @@  int cmd_rebase(int argc, const char **argv, const char *prefix)
 		OPT_STRING_LIST('x', "exec", &exec, N_("exec"),
 				N_("add exec lines after each commit of the "
 				   "editable list")),
-		OPT_BOOL(0, "allow-empty-message",
-			 &options.allow_empty_message,
-			 N_("allow rebasing commits with empty messages")),
+		OPT_BOOL_F(0, "allow-empty-message",
+			   &options.allow_empty_message,
+			   N_("allow rebasing commits with empty messages"),
+			   PARSE_OPT_HIDDEN),
 		{OPTION_STRING, 'r', "rebase-merges", &rebase_merges,
 			N_("mode"),
 			N_("try to rebase merges instead of skipping them"),