display asctime_r
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
diff --git a/.gitignore b/.gitignore
index eecd321..0789537 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
**/obj
+libexec/**
+gotweb/**
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 48c0792..0f1b510 100644
--- a/gotweb/gotweb.c
+++ b/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 {
@@ -281,6 +283,14 @@ gw_commit_diff(struct trans *gw_trans)
}
static const struct got_error *
+gw_heads(struct trans *gw_trans)
+{
+ const struct got_error *error = NULL;
+
+ return error;
+}
+
+static const struct got_error *
gw_history(struct trans *gw_trans)
{
const struct got_error *error = NULL;
@@ -412,9 +422,20 @@ 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;
}
@@ -837,6 +858,7 @@ gw_get_repo_age(struct trans *gw_trans, char *dir, char *repo_ref, int ref_tm)
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, char *repo_ref, int ref_tm)
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)