diff mbox series

[GSoC,v7,1/6] advice: add sequencerInUse config variable

Message ID 20190623200338.17144-2-rohit.ashiwal265@gmail.com (mailing list archive)
State New, archived
Headers show
Series Teach cherry-pick/revert to skip commits | expand

Commit Message

Rohit Ashiwal June 23, 2019, 8:03 p.m. UTC
Calls to advise() which are not guarded by advice.* config variables
are "bad" as they do not let the user say, "I've learned this part
of Git enough, please don't tell me what to do verbosely.". Add a
configuration variable "sequencerInUse" which controls whether to
display advice when any sequencer command is in progress.

Signed-off-by: Rohit Ashiwal <rohit.ashiwal265@gmail.com>
---
 Documentation/config/advice.txt | 2 ++
 advice.c                        | 2 ++
 advice.h                        | 1 +
 3 files changed, 5 insertions(+)

Comments

Thomas Gummerer June 25, 2019, 9:18 a.m. UTC | #1
On 06/24, Rohit Ashiwal wrote:
> Calls to advise() which are not guarded by advice.* config variables
> are "bad" as they do not let the user say, "I've learned this part
> of Git enough, please don't tell me what to do verbosely.". Add a
> configuration variable "sequencerInUse" which controls whether to
> display advice when any sequencer command is in progress.

It would be nice if this patch not only introduced this config
variable, but also started making use of it.  That would make it
immediately clear why this variable is useful.  Otherwise the commit
message should state that this is only useful in a future commit.

Not sure that's worth a reroll by itself though.

> Signed-off-by: Rohit Ashiwal <rohit.ashiwal265@gmail.com>
> ---
>  Documentation/config/advice.txt | 2 ++
>  advice.c                        | 2 ++
>  advice.h                        | 1 +
>  3 files changed, 5 insertions(+)
> 
> diff --git a/Documentation/config/advice.txt b/Documentation/config/advice.txt
> index ec4f6ae658..1cd9096c98 100644
> --- a/Documentation/config/advice.txt
> +++ b/Documentation/config/advice.txt
> @@ -57,6 +57,8 @@ advice.*::
>  	resolveConflict::
>  		Advice shown by various commands when conflicts
>  		prevent the operation from being performed.
> +	sequencerInUse::
> +		Advice shown when a sequencer command is already in progress.
>  	implicitIdentity::
>  		Advice on how to set your identity configuration when
>  		your information is guessed from the system username and
> diff --git a/advice.c b/advice.c
> index ce5f374ecd..b101f0c264 100644
> --- a/advice.c
> +++ b/advice.c
> @@ -15,6 +15,7 @@ int advice_status_u_option = 1;
>  int advice_commit_before_merge = 1;
>  int advice_reset_quiet_warning = 1;
>  int advice_resolve_conflict = 1;
> +int advice_sequencer_in_use = 1;
>  int advice_implicit_identity = 1;
>  int advice_detached_head = 1;
>  int advice_set_upstream_failure = 1;
> @@ -71,6 +72,7 @@ static struct {
>  	{ "commitBeforeMerge", &advice_commit_before_merge },
>  	{ "resetQuiet", &advice_reset_quiet_warning },
>  	{ "resolveConflict", &advice_resolve_conflict },
> +	{ "sequencerInUse", &advice_sequencer_in_use },
>  	{ "implicitIdentity", &advice_implicit_identity },
>  	{ "detachedHead", &advice_detached_head },
>  	{ "setupStreamFailure", &advice_set_upstream_failure },
> diff --git a/advice.h b/advice.h
> index e50f02cdfe..ebc838d7bc 100644
> --- a/advice.h
> +++ b/advice.h
> @@ -15,6 +15,7 @@ extern int advice_status_u_option;
>  extern int advice_commit_before_merge;
>  extern int advice_reset_quiet_warning;
>  extern int advice_resolve_conflict;
> +extern int advice_sequencer_in_use;
>  extern int advice_implicit_identity;
>  extern int advice_detached_head;
>  extern int advice_set_upstream_failure;
> -- 
> 2.21.0
>
diff mbox series

Patch

diff --git a/Documentation/config/advice.txt b/Documentation/config/advice.txt
index ec4f6ae658..1cd9096c98 100644
--- a/Documentation/config/advice.txt
+++ b/Documentation/config/advice.txt
@@ -57,6 +57,8 @@  advice.*::
 	resolveConflict::
 		Advice shown by various commands when conflicts
 		prevent the operation from being performed.
+	sequencerInUse::
+		Advice shown when a sequencer command is already in progress.
 	implicitIdentity::
 		Advice on how to set your identity configuration when
 		your information is guessed from the system username and
diff --git a/advice.c b/advice.c
index ce5f374ecd..b101f0c264 100644
--- a/advice.c
+++ b/advice.c
@@ -15,6 +15,7 @@  int advice_status_u_option = 1;
 int advice_commit_before_merge = 1;
 int advice_reset_quiet_warning = 1;
 int advice_resolve_conflict = 1;
+int advice_sequencer_in_use = 1;
 int advice_implicit_identity = 1;
 int advice_detached_head = 1;
 int advice_set_upstream_failure = 1;
@@ -71,6 +72,7 @@  static struct {
 	{ "commitBeforeMerge", &advice_commit_before_merge },
 	{ "resetQuiet", &advice_reset_quiet_warning },
 	{ "resolveConflict", &advice_resolve_conflict },
+	{ "sequencerInUse", &advice_sequencer_in_use },
 	{ "implicitIdentity", &advice_implicit_identity },
 	{ "detachedHead", &advice_detached_head },
 	{ "setupStreamFailure", &advice_set_upstream_failure },
diff --git a/advice.h b/advice.h
index e50f02cdfe..ebc838d7bc 100644
--- a/advice.h
+++ b/advice.h
@@ -15,6 +15,7 @@  extern int advice_status_u_option;
 extern int advice_commit_before_merge;
 extern int advice_reset_quiet_warning;
 extern int advice_resolve_conflict;
+extern int advice_sequencer_in_use;
 extern int advice_implicit_identity;
 extern int advice_detached_head;
 extern int advice_set_upstream_failure;