[PATCH 0/4] approxidate for "git commit --date=foo"
From: Jeff King <hidden>
Date: 2016-06-15 23:00:58
On Thu, May 01, 2014 at 06:06:39PM -0400, Jeff King wrote:
quoted
I think the original rationale was that it's OK for us to allow some sloppiness when _viewing_ commits, since you will generally notice the problem. But when making commits, it's better to be careful, since you may be setting the sha1 in stone. These days we have two tools that could help: 1. approxidate_careful will do a regular approxidate, but keep track of whether we found anything even remotely useful. That doesn't mean you can't still get unexpected results, but at least some truly useless cases return errors. 2. For commits with a different author and committer, we mention the author name in the post-commit summary. We could do the same with a timestamp that was given (i.e., mentioning it in a standard format) to give the user another opportunity to double-check what we parsed.I think it would make sense if we followed both of those points.
Here are patches to do so. [1/4]: commit: use split_ident_line to compare author/committer [2/4]: pretty: make show_ident_date public [3/4]: commit: print "Date" line when the user has set date [4/4]: commit: accept more date formats for "--date" -Peff