From 542a1ade8033d03513647ace64e50dbf31cb5e68 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 3 Sep 2019 11:31:14 +0900 Subject: --date=iso-local does not work with old git --- tool/lib/vcs.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tool/lib/vcs.rb') diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb index 620ac1bfeb..65eb774d38 100644 --- a/tool/lib/vcs.rb +++ b/tool/lib/vcs.rb @@ -618,9 +618,15 @@ class VCS end def format_changelog(path, arg) - cmd = %W"#{COMMAND} log --format=medium --notes=commits --date=iso-local --topo-order" + env = {'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'} + cmd = %W"#{COMMAND} log --format=medium --notes=commits --topo-order" + date = "--date=iso-local" + unless system(env, *cmd, date, chdir: @srcdir, out: NullDevice, exception: false) + date = "--date=iso" + end + cmd << date cmd.concat(arg) - system({'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'}, *cmd, chdir: @srcdir, out: path) + system(env, *cmd, chdir: @srcdir, out: path) end def upstream -- cgit v1.2.3