@@ -143,7 +143,7 @@ let condense_file_changes files =
143
143
|> List. drop_last_exn
144
144
|> String. concat ~sep: " /"
145
145
in
146
- if String. is_empty prefix_path then " " else sprintf " in `%s/`" prefix_path
146
+ if String. is_empty prefix_path then " " else sprintf " modified %d files in `%s/`" ( List. length files) prefix_path
147
147
148
148
let populate_commit ?(include_changes = true ) repository (commit : api_commit ) =
149
149
let ({ sha; commit; url; author; files; _ } : api_commit ) = commit in
@@ -175,19 +175,17 @@ let populate_commit ?(include_changes = true) repository (commit : api_commit) =
175
175
in
176
176
( match List. map ~f: Int. of_string @@ String. split date ~on: '-' with
177
177
| [ y; m; d ] when y = yy && m = mm && d = dd -> " today"
178
- | [ y; m; d ] when y = yy -> sprintf " on %s %d" (month m) d
179
- | _ -> date
178
+ | [ y; m; d ] when y = yy -> sprintf " on %s %d" (month m) d
179
+ | _ -> " on " ^ date
180
180
)
181
181
| _ -> failwith " wut"
182
- with _ -> " on " ^ commit.author.date
182
+ with _ -> " on " ^ commit.author.date
183
183
in
184
- sprintf " modified %d files%s %s" (List. length files) where when_
185
- in
186
- let text =
187
- match include_changes with
188
- | false -> sprintf " %s\n " title
189
- | true -> sprintf " %s\n %s" title (changes () )
184
+ match where, when_ with
185
+ | "" , when_ -> when_
186
+ | where , when_ -> sprintf " %s %s" where when_
190
187
in
188
+ let text = sprintf " %s\n %s" title (if include_changes then changes () else " " ) in
191
189
let fallback = sprintf " [%s] %s - %s" (Slack. git_short_sha_hash sha) commit.message commit.author.name in
192
190
{
193
191
(base_attachment repository) with
0 commit comments