git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add format.date config variable

From
Junio C Hamano <junio@pobox.com>
Date
May 21, 2008, 18:24 UTC
Message-ID
<7vtzgr347p.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080518171306.GA12948@zakalwe.fi>
Heikki Orsila <heikki.orsila@iki.fi> writes:
Show 5 quoted lines
> format.date config variable sets the default date-time mode for the log
> command. Setting format.date value is similar to using git log's --date
> option.
>
> Also, add missing "short" alternative to --date in rev-list-options.txt.
Good change but is a separate issue.  Please make it a [PATCH 1/2].
> ---
Lacking Sign-off.
> I wanted to read all the logs in ISO 8601 time format so I decided to 
> implement this option.
Good intention.
Show 14 quoted lines
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 217980f..ddc68bd 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -573,6 +573,12 @@ fetch.unpackLimit::
>  	especially on slow filesystems.  If not set, the value of
>  	`transfer.unpackLimit` is used instead.
>  
> +format.date::
> +	Set default date-time mode for the log command. Setting format.date
> +	value is similar to using git log's --date option. The value is one of
> +	following alternatives: {relative,local,default,iso,rfc,short}.
> +	See linkgit:git-log[1].
> +

Look at other "format.*" variables --- notice that most of them are about "format-patch" command? And you absolutely do NOT want this "default date format for log family" to apply to "format-patch" command.

Show 5 quoted lines
> diff --git a/builtin-log.c b/builtin-log.c
> index 9d046b2..d3ff8f6 100644
> --- a/builtin-log.c
> +++ b/builtin-log.c
> @@ -18,6 +18,9 @@

The patch itself is good, especially that you made sure that format-patch output is not affected.

As to the configuration variable name, I'd suggest "log.date" instead. We may have to deprecate format.pretty and move it to something else for consistency, though. Just like we do not want "format.date" applied to format-patch, we never want "format.pretty" apply to it either.

Previous: Teemu LikonenNext: Heikki Orsila
Message 3 of 4 in “Add format.date config variable”
  1. Add format.date config variableHeikki Orsila, May 18, 2008
  2. Teemu LikonenMay 18, 2008
  3. Junio C HamanoMay 21, 2008
  4. Heikki OrsilaMay 21, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.