"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Tracey Emery <tracey@traceyemery.net>
Subject:
blame display
To:
gameoftrees@openbsd.org
Date:
Sat, 19 Oct 2019 10:07:37 -0600

Download raw body.

Thread
  • Tracey Emery:

    blame display

Hello,

In got blame, is there some rationale to using a two-digit year over a
four-digit year? Just curious. It looks funny to me and made me feel
like it was 1997.

Does it make sense to move it to four digits?

-- 

Tracey Emery

diff a651202a0e6ce0b79e1be76ebf349a28f4c40bb8 /home/basepr1me/Documents/got/public/got
blob - 5423c33764d81bfc3fd2c71dc7f9ca32f22bad4a
file + got/got.c
--- got/got.c
+++ got/got.c
@@ -2349,7 +2349,7 @@ struct blame_line {
 	int annotated;
 	char *id_str;
 	char *committer;
-	char datebuf[9]; /* YY-MM-DD + NUL */
+	char datebuf[11]; /* YYYY-MM-DD + NUL */
 };
 
 struct blame_cb_args {
@@ -2406,7 +2406,7 @@ blame_cb(void *arg, int nlines, int lineno, struct got
 	committer_time = got_object_commit_get_committer_time(commit);
 	if (localtime_r(&committer_time, &tm) == NULL)
 		return got_error_from_errno("localtime_r");
-	if (strftime(bline->datebuf, sizeof(bline->datebuf), "%g/%m/%d",
+	if (strftime(bline->datebuf, sizeof(bline->datebuf), "%G/%m/%d",
 	    &tm) >= sizeof(bline->datebuf)) {
 		err = got_error(GOT_ERR_NO_SPACE);
 		goto done;