commit 2ec65f6ace3f488fb0e548653237ce7a9c6da4d4 from: Sven M. Hallberg date: Mon Jun 16 13:40:28 2025 UTC show author date if GOT_SHOW_AUTHOR_DATE is set commit - 2444c4b4557ad5f4280ab1995a634e4417897917 commit + 2ec65f6ace3f488fb0e548653237ce7a9c6da4d4 blob - a5bdba20fbfdf3cd131ffb9a646559556bc5f2fd blob + 94069b2951a19b5e8b07e44cfcc9dd6f90fd2b1e --- got/got.c +++ got/got.c @@ -4420,7 +4420,7 @@ print_commit(struct got_commit_object *commit, struct FILE *f = NULL; char *id_str, *datestr, *logmsg0, *logmsg, *line; char datebuf[26]; - time_t committer_time; + time_t timestamp; const char *author, *committer; char *refs_str = NULL; @@ -4455,8 +4455,11 @@ print_commit(struct got_commit_object *commit, struct committer = got_object_commit_get_committer(commit); if (strcmp(author, committer) != 0) printf("via: %s\n", committer); - committer_time = got_object_commit_get_committer_time(commit); - datestr = get_datestr(&committer_time, datebuf); + if (getenv("GOT_SHOW_AUTHOR_DATE") != NULL) + timestamp = got_object_commit_get_author_time(commit); + else + timestamp = got_object_commit_get_committer_time(commit); + datestr = get_datestr(×tamp, datebuf); if (datestr) printf("date: %s UTC\n", datestr); if (got_object_commit_get_nparents(commit) > 1) { blob - bbe1eec2d576b289548f767deccdd88c00adeaf8 blob + deeaeb8017b6dd88fd0d484c0e49c0a4d6236749 --- tog/tog.c +++ tog/tog.c @@ -4558,7 +4558,7 @@ open_log_view(struct tog_view *view, struct got_object goto done; } s->log_branches = log_branches; - s->use_committer = 1; + s->use_committer = (getenv("GOT_SHOW_AUTHOR_DATE") == NULL); STAILQ_INIT(&s->colors); if (has_colors() && getenv("TOG_COLORS") != NULL) { @@ -6910,7 +6910,7 @@ open_diff_view(struct tog_view *view, struct got_objec s->force_text_diff = force_text_diff; s->diff_worktree = diff_worktree; s->diff_staged = diff_staged; - s->use_committer = 1; + s->use_committer = (getenv("GOT_SHOW_AUTHOR_DATE") == NULL); s->parent_view = parent_view; s->paths = paths; s->repo = repo;