From: Junio C Hamano Date: Wed, 15 Apr 2015 17:04:55 GMT Subject: Re: Odd broken "--date=now" behavior in current git Message-ID: In-Reply-To: Linus Torvalds writes: > On Wed, Apr 15, 2015 at 12:22 AM, Eric Sunshine wrote: >> >> The fix seems to be simply: > > Yup, that seems to do it for me. I'm not sure how we get to > "match_digit()" with the time string "now", though. The --date= parameter is read by determine_author_info() and then parse_force_date(), both in builtin/commit.c. This calls parse_date(), which first calls (and fails) parse_date_basic() when it is not a strict timestamp. "now", "4.days.ago", etc. are then passed to approxidate_careful() which in turn calls approxidate_str(). Note that the approxidate formats do not usually spell out the TZ offset. The result is turned into "@" by parse_force_date(). The string "@" without TZ offset is re-interpreted by parse_date() called by fmt_ident(); the last function prepares the author ident line "Name ". The --date= does not force committer information, which goes through the usual codepath of grabbing the "current" time.