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

Re: git log use of date format differs between Command Line and script usage.

From
SUShaun Uldrikis <stuldrikis@gmail.com>
Date
Jun 30, 2017, 17:29 UTC
Message-ID
<CADHEqX9-w5uZpS1RiP9EjCpWB0V1SVYZ5Ddsv3etCvBteOv4qg@mail.gmail.com>
In-Reply-To
<CAGZ79kZxde9j+O4JDofYLbC2CRk_X0tiwOftEgKQcJLyN409xQ@mail.gmail.com>

Yes. That is the case. Just confirmed it. I'll remove the old version. Sorry to have bothered the mailing list.

Thank you.
-Shaun
On Fri, Jun 30, 2017 at 12:43 PM, Stefan Beller <sbeller@google.com> wrote:
Show 29 quoted lines
> On Fri, Jun 30, 2017 at 9:06 AM, Shaun Uldrikis <stuldrikis@gmail.com> wrote:
>> If you supply a non-standard format to the date configuration for git
>> log, something like:
>> [log]
>>         date = format:%Y-%m-%d %H:%M
>
> So I ran
>
>     $ git config log.date  "format:%Y-%m-%d %H:%M"
>     $ git config --list |grep log.date
>     log.date=format:%Y-%m-%d %H:%M
>
> Then I have a script as
>   $ cat script.sh
>   #!/bin/sh
>
>   git log >out
>
> after executing I get:
>
>   $ head out
>   commit 7930db48ca31b41ac335ae8cd25cb29094d1de5e
>   Author: Stefan Beller <sbeller@google.com>
>   Date:   2017-06-30 09:26
>
> Also gitk seems to work here.
>
> Rene's answer sounds reasonable,
> check the version(s) of Git on your system?
Previous: Stefan Beller
Message 4 of 4 in “git log use of date format differs between Command Line and script usage.”
  1. Shaun UldrikisJun 30, 2017
  2. René ScharfeJun 30, 2017
  3. Stefan BellerJun 30, 2017
  4. Shaun UldrikisJun 30, 2017

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.