git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matthieu Moy <git@matthieu-moy.fr>
To: Roland Hieber <rhi@pengutronix.de>
Cc: Git Mailing List <git@vger.kernel.org>,
	Michael Haggerty <mhagger@alum.mit.edu>,
	Junio C Hamano <gitster@pobox.com>,
	Stefan Beller <stefanbeller@gmail.com>
Subject: Re: [PATCH] reflog: specify default pretty format in config
Date: Wed, 30 Jan 2019 19:22:49 +0100 (CET)	[thread overview]
Message-ID: <361643257.4118832.1548872569575.JavaMail.zimbra@matthieu-moy.fr> (raw)
In-Reply-To: <20190130144744.3248-1-rhi@pengutronix.de>

Roland Hieber <rhi@pengutronix.de> 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/

  reply	other threads:[~2019-01-30 19:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30 14:47 [PATCH] reflog: specify default pretty format in config Roland Hieber
2019-01-30 18:22 ` Matthieu Moy [this message]
2019-01-31 10:12   ` Roland Hieber
2019-02-08 18:31 ` [PATCH v2] " Roland Hieber
2019-02-11 19:54   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=361643257.4118832.1548872569575.JavaMail.zimbra@matthieu-moy.fr \
    --to=git@matthieu-moy.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mhagger@alum.mit.edu \
    --cc=rhi@pengutronix.de \
    --cc=stefanbeller@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).