Re: [PATCH] builtin/log: honor log.decorate

2017-05-12 Thread brian m. carlson
On Fri, May 12, 2017 at 04:03:04PM -0600, Alex Henrie wrote:
> > diff --git a/builtin/log.c b/builtin/log.c
> > index b3b10cc1e..304923836 100644
> > --- a/builtin/log.c
> > +++ b/builtin/log.c
> > @@ -34,7 +34,7 @@ static int default_abbrev_commit;
> >  static int default_show_root = 1;
> >  static int default_follow;
> >  static int default_show_signature;
> > -static int decoration_style;
> > +static int decoration_style = -1;
> >  static int decoration_given;
> >  static int use_mailmap_config;
> >  static const char *fmt_patch_subject_prefix = "PATCH";
> > @@ -410,7 +410,7 @@ static int git_log_config(const char *var, const char 
> > *value, void *cb)
> > if (decoration_style < 0)
> > decoration_style = 0; /* maybe warn? */
> > return 0;
> > -   } else {
> > +   } else if (decoration_style == -1) {
> > decoration_style = auto_decoration_style();
> > }
> > if (!strcmp(var, "log.showroot")) {
> 
> Sorry for the mistake. On second thought, I think we should set
> decoration_style = auto_decoration_style() in init_log_defaults.

I can do that.  Patch forthcoming shortly.
-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: https://keybase.io/bk2204


signature.asc
Description: PGP signature


Re: [PATCH] builtin/log: honor log.decorate

2017-05-12 Thread Alex Henrie
2017-05-12 15:34 GMT-06:00 brian m. carlson :
> The recent change that introduced autodecorating of refs accidentally
> broke the ability of users to set log.decorate = false to override it.
> When the git_log_config was traversed a second time with an option other
> than log.decorate, the decoration style would be set to the automatic
> style, even if the user had already overridden it.  Only set the option
> to its default value if we haven't set it already.
>
> Signed-off-by: brian m. carlson 
> ---
>  builtin/log.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/log.c b/builtin/log.c
> index b3b10cc1e..304923836 100644
> --- a/builtin/log.c
> +++ b/builtin/log.c
> @@ -34,7 +34,7 @@ static int default_abbrev_commit;
>  static int default_show_root = 1;
>  static int default_follow;
>  static int default_show_signature;
> -static int decoration_style;
> +static int decoration_style = -1;
>  static int decoration_given;
>  static int use_mailmap_config;
>  static const char *fmt_patch_subject_prefix = "PATCH";
> @@ -410,7 +410,7 @@ static int git_log_config(const char *var, const char 
> *value, void *cb)
> if (decoration_style < 0)
> decoration_style = 0; /* maybe warn? */
> return 0;
> -   } else {
> +   } else if (decoration_style == -1) {
> decoration_style = auto_decoration_style();
> }
> if (!strcmp(var, "log.showroot")) {

Sorry for the mistake. On second thought, I think we should set
decoration_style = auto_decoration_style() in init_log_defaults.

-Alex


[PATCH] builtin/log: honor log.decorate

2017-05-12 Thread brian m. carlson
The recent change that introduced autodecorating of refs accidentally
broke the ability of users to set log.decorate = false to override it.
When the git_log_config was traversed a second time with an option other
than log.decorate, the decoration style would be set to the automatic
style, even if the user had already overridden it.  Only set the option
to its default value if we haven't set it already.

Signed-off-by: brian m. carlson 
---
 builtin/log.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/log.c b/builtin/log.c
index b3b10cc1e..304923836 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -34,7 +34,7 @@ static int default_abbrev_commit;
 static int default_show_root = 1;
 static int default_follow;
 static int default_show_signature;
-static int decoration_style;
+static int decoration_style = -1;
 static int decoration_given;
 static int use_mailmap_config;
 static const char *fmt_patch_subject_prefix = "PATCH";
@@ -410,7 +410,7 @@ static int git_log_config(const char *var, const char 
*value, void *cb)
if (decoration_style < 0)
decoration_style = 0; /* maybe warn? */
return 0;
-   } else {
+   } else if (decoration_style == -1) {
decoration_style = auto_decoration_style();
}
if (!strcmp(var, "log.showroot")) {