@@ -37,13 +37,10 @@ let empty_attachment =
37
37
footer = None ;
38
38
}
39
39
40
- let base_attachment (repository : repository ) =
41
- { empty_attachment with footer = Some (sprintf " <%s|%s>" repository.url (escape_mrkdwn repository.full_name)) }
42
-
40
+ let simple_footer (repository : repository ) = sprintf " <%s|%s>" repository.url (escape_mrkdwn repository.full_name)
41
+ let base_attachment repository = { empty_attachment with footer = Some (simple_footer repository) }
43
42
let pp_label (label : label ) = label.name
44
-
45
43
let pp_github_user (user : github_user ) = gh_name_of_string user.login
46
-
47
44
let pp_github_team (team : github_team ) = gh_name_of_string team.slug
48
45
49
46
let populate_pull_request repository (pull_request : pull_request ) =
@@ -137,12 +134,20 @@ let populate_commit repository (commit : api_commit) =
137
134
|> List. drop_last_exn
138
135
|> String. concat ~sep: " /"
139
136
in
140
- sprintf " modified %d files in `%s/`" (List. length files) prefix_path
137
+ let where = if String. is_empty prefix_path then " " else sprintf " in `%s/`" prefix_path in
138
+ (* TODO use "today" on same day, "Month Day" during same year
139
+ even better would be to have "N units ago" and tooltip, but looks like slack doesn't provide such thing *)
140
+ sprintf " modified %d files%s on %s" (List. length files) where commit.author.date
141
141
in
142
142
let text = sprintf " %s\n %s" title changes in
143
143
let fallback = sprintf " [%s] %s - %s" (Slack. git_short_sha_hash sha) commit.message commit.author.name in
144
144
{
145
145
(base_attachment repository) with
146
+ footer =
147
+ Some
148
+ (simple_footer repository
149
+ ^ if String. equal commit.committer.date commit.author.date then " " else " " ^ commit.committer.date
150
+ );
146
151
(*
147
152
author_name = Some author.login;
148
153
author_link = Some author.html_url;
0 commit comments