commit 2204c9343930bbc529ccda400678b21c3513af67 from: Tracey Emery date: Wed Jan 15 22:10:30 2020 UTC display asctime_r commit - 387a29ba0be6aa0e59ef9a8f3f18564079b6aa88 commit + 2204c9343930bbc529ccda400678b21c3513af67 blob - eecd321da5ab5335eee50eef2c98ad64e4a941c2 blob + 07895374f3a60def01d080e35d800e01125ae793 --- .gitignore +++ .gitignore @@ -1 +1,3 @@ **/obj +libexec/** +gotweb/** blob - 48c07924b4fb065bd5524cc99e8a0c1aac9e4364 blob + 0f1b510a75fbfc590305ae7c3b34785006995a99 --- gotweb/gotweb.c +++ gotweb/gotweb.c @@ -161,6 +161,7 @@ static const struct got_error* gw_blob(struct trans * static const struct got_error* gw_blob_diff(struct trans *); static const struct got_error* gw_commit(struct trans *); static const struct got_error* gw_commit_diff(struct trans *); +static const struct got_error* gw_heads(struct trans *); static const struct got_error* gw_history(struct trans *); static const struct got_error* gw_index(struct trans *); static const struct got_error* gw_log(struct trans *); @@ -168,6 +169,7 @@ static const struct got_error* gw_raw(struct trans *) static const struct got_error* gw_shortlog(struct trans *); static const struct got_error* gw_snapshot(struct trans *); static const struct got_error* gw_summary(struct trans *); +static const struct got_error* gw_tags(struct trans *); static const struct got_error* gw_tree(struct trans *); struct gw_query_action { @@ -274,6 +276,14 @@ gw_commit(struct trans *gw_trans) static const struct got_error * gw_commit_diff(struct trans *gw_trans) +{ + const struct got_error *error = NULL; + + return error; +} + +static const struct got_error * +gw_heads(struct trans *gw_trans) { const struct got_error *error = NULL; @@ -412,13 +422,24 @@ gw_summary(struct trans *gw_trans) { const struct got_error *error = NULL; - khttp_puts(gw_trans->gw_req, summary_shortlog); - khttp_puts(gw_trans->gw_req, summary_tags); - khttp_puts(gw_trans->gw_req, summary_heads); + error = gw_shortlog(gw_trans); + error = gw_tags(gw_trans); + error = gw_heads(gw_trans); + khttp_puts(gw_trans->gw_req, summary_shortlog); + khttp_puts(gw_trans->gw_req, summary_tags); + khttp_puts(gw_trans->gw_req, summary_heads); return error; } static const struct got_error * +gw_tags(struct trans *gw_trans) +{ + const struct got_error *error = NULL; + + return error; +} + +static const struct got_error * gw_tree(struct trans *gw_trans) { const struct got_error *error = NULL; @@ -837,6 +858,7 @@ gw_get_repo_age(struct trans *gw_trans, char *dir, cha char *weeks = "weeks ago", *days = "days ago", *hours = "hours ago"; char *minutes = "minutes ago", *seconds = "seconds ago"; char *now = "right now"; + char *s; char datebuf[BUFFER_SIZE]; if (repo_ref == NULL) @@ -924,12 +946,12 @@ gw_get_repo_age(struct trans *gw_trans, char *dir, cha if (cmp_time != 0) { if (gmtime_r(&committer_time, &tm) == NULL) return NULL; - if (strftime(datebuf, sizeof(datebuf), - "%G-%m-%d %H:%M:%S (%z)", - &tm) >= sizeof(datebuf)) + + s = asctime_r(&tm, datebuf); + if (s == NULL) return NULL; - if ((asprintf(&repo_age, "%s", datebuf)) == -1) + if ((asprintf(&repo_age, "%s UTC", datebuf)) == -1) return NULL; } else { if ((asprintf(&repo_age, "")) == -1)