From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 2B8161F453 for ; Wed, 30 Jan 2019 19:06:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733275AbfA3TGO (ORCPT ); Wed, 30 Jan 2019 14:06:14 -0500 Received: from mut-mta1-se01a-zose1-rescue-fr.yulpa.io ([185.49.21.247]:41258 "EHLO mut-mta1-se01a-zose1-rescue-fr.yulpa.io" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733109AbfA3TGO (ORCPT ); Wed, 30 Jan 2019 14:06:14 -0500 X-Greylist: delayed 2594 seconds by postgrey-1.27 at vger.kernel.org; Wed, 30 Jan 2019 14:06:13 EST Received: from mut-zose1-mta-hub-out01-fr.yulpa.io ([185.49.20.54] helo=mut-zose1-mta-hub-outweb01a-fr.yulpa.io) by mut-mta1-se01c-fr.yulpa.io with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1gouVg-000074-Vu; Wed, 30 Jan 2019 19:22:54 +0100 Received: from localhost (localhost [127.0.0.1]) by mut-zose1-mta-hub-outweb01a-fr.yulpa.io (Postfix) with ESMTP id 02F42C1F35; Wed, 30 Jan 2019 19:22:51 +0100 (CET) Received: from mut-zose1-mta-hub-outweb01a-fr.yulpa.io ([127.0.0.1]) by localhost (mut-zose1-mta-hub-outweb01a-fr.yulpa.io [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Zanh2R8uURAO; Wed, 30 Jan 2019 19:22:50 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mut-zose1-mta-hub-outweb01a-fr.yulpa.io (Postfix) with ESMTP id 71EF3C20AC; Wed, 30 Jan 2019 19:22:50 +0100 (CET) X-Virus-Scanned: amavisd-new at mut-zose1.yulpa.io Received: from mut-zose1-mta-hub-outweb01a-fr.yulpa.io ([127.0.0.1]) by localhost (mut-zose1-mta-hub-outweb01a-fr.yulpa.io [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id hv9u0lF8tvm5; Wed, 30 Jan 2019 19:22:50 +0100 (CET) Received: from zose-store11.web4all.fr (zose-store11.web4all.fr [10.101.13.41]) by mut-zose1-mta-hub-outweb01a-fr.yulpa.io (Postfix) with ESMTP id 498F9C1F35; Wed, 30 Jan 2019 19:22:50 +0100 (CET) Date: Wed, 30 Jan 2019 19:22:49 +0100 (CET) From: Matthieu Moy To: Roland Hieber Cc: Git Mailing List , Michael Haggerty , Junio C Hamano , Stefan Beller Message-ID: <361643257.4118832.1548872569575.JavaMail.zimbra@matthieu-moy.fr> In-Reply-To: <20190130144744.3248-1-rhi@pengutronix.de> References: <20190130144744.3248-1-rhi@pengutronix.de> Subject: Re: [PATCH] reflog: specify default pretty format in config MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Mailer: Zimbra 8.8.9_GA_3019 (ZimbraWebClient - FF64 (Linux)/8.8.9_GA_3019) Thread-Topic: reflog: specify default pretty format in config Thread-Index: DxJQEZwFa8JVbzcFAjwtB3UHJr3m4Q== X-Originating-IP: 185.49.20.54 X-yulPa-Domain: mut-zose1.yulpa.io X-yulPa-Username: 185.49.20.54 Authentication-Results: yulpa.io; auth=pass smtp.auth=185.49.20.54@mut-zose1.yulpa.io X-yulPa-Outgoing-Class: ham X-yulPa-Outgoing-Evidence: Combined (0.05) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5lOMEQZOR9YwrOkrPHt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HI0C/U 3fmRhZoR2Au6S5TMxvd8NdRV1gKYQ/ojqkADbc/I6fiP72XzLwNVEQA= X-Report-Abuse-To: spam@mut-mta1-se01a-fr.yulpa.io Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Roland Hieber writes: > The output of git-reflog is currently only customizable by calling > reflog with --pretty=... or overriding the default "oneline" pretty > format in the configuration. Sounds like a good idea to me, but the patch needs a bit more work: > Documentation/git-reflog.txt | 2 ++ It's nice to refer to the config variable in git-reflog.txt, but you should also document it in some Documentation/config/*.txt file, included from Documentation/config.txt, so that it appears in man git-config. > builtin/log.c | 12 +++++++++--- > 2 files changed, 11 insertions(+), 3 deletions(-) This lacks tests, too (t/*.sh). > --- a/builtin/log.c > +++ b/builtin/log.c > @@ -667,6 +667,7 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix) > { > struct rev_info rev; > struct setup_revision_opt opt; > + int cfg_have_pretty; > > init_log_defaults(); > git_config(git_log_config, NULL); > @@ -676,11 +677,16 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix) > rev.verbose_header = 1; > memset(&opt, 0, sizeof(opt)); > opt.def = "HEAD"; > + > + cfg_have_pretty = git_config_get_string_const("reflog.pretty", &fmt_pretty); > cmd_log_init_defaults(&rev); > - rev.abbrev_commit = 1; > - rev.commit_format = CMIT_FMT_ONELINE; > - rev.use_terminator = 1; > + if (cfg_have_pretty != 0) { I'd write just "if (cfg_have_pretty)". > rev.always_show_header = 1; > + > cmd_log_init_finish(argc, argv, prefix, &rev, &opt); Avoid adding unrelated whitespace changes like this one. Regards, -- Matthieu Moy https://matthieu-moy.fr/