From: Jeff King Date: Sat, 22 Apr 2023 13:41:50 GMT Subject: [PATCH 0/3] fixing some parse_commit() timestamp corner cases Message-ID: <20230422134150.GA3516940@coredump.intra.peff.net> In-Reply-To: <1153e31d-2f89-c9dc-8551-adf4d3822487@cs.uni-saarland.de> On Fri, Apr 21, 2023 at 04:51:03PM +0200, Thomas Bock wrote: > Even though the affected commit objects are malformed, it would be very > helpful if this problem could be solved somehow, from a user perspective. > Such malformed objects can potentially occur also in other comparably old > projects, where searching for commits that have been made in a specific time > window in the past could be useful or even necessary in some cases. Yeah, after sleeping on it for a bit, I think it is worth fixing. I also found another parsing bug in the same function. ;) So here's the result. [1/3]: t4212: avoid putting git on left-hand side of pipe [2/3]: parse_commit(): parse timestamp from end of line [3/3]: parse_commit(): handle broken whitespace-only timestamp commit.c | 29 +++++++++++++++++++++------- t/t4212-log-corrupt.sh | 44 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 9 deletions(-) -Peff