@@ -2009,6 +2009,7 @@ static void expire_commit_graphs(struct write_commit_graph_context *ctx)
struct dirent *de;
size_t dirnamelen;
timestamp_t expire_time = time(NULL);
+ int commit_graph_deleted = 0;
if (ctx->split_opts && ctx->split_opts->expire_time)
expire_time = ctx->split_opts->expire_time;
@@ -2050,8 +2051,38 @@ static void expire_commit_graphs(struct write_commit_graph_context *ctx)
}
}
- if (!found)
+ if (!found) {
+ if (trace2_is_enabled()) {
+ struct strbuf message = STRBUF_INIT;
+
+ strbuf_addf(&message, "Deleting '%s' because it is not in [", path.buf);
+ for (i = 0; i < ctx->num_commit_graphs_after; i++) {
+ if (i != 0)
+ strbuf_addstr(&message, ", ");
+ strbuf_addf(&message, "'%s'", ctx->commit_graph_filenames_after[i]);
+ }
+ strbuf_addstr(&message, "]");
+ trace2_data_string("commit-graph", the_repository, "graph-deletion", message.buf);
+ strbuf_release(&message);
+ commit_graph_deleted = 1;
+ }
unlink(path.buf);
+ }
+ }
+
+ if (commit_graph_deleted) {
+ struct strbuf message = STRBUF_INIT;
+ uint32_t i;
+
+ strbuf_addstr(&message, "The commit graphs before were [");
+ for (i = 0; i < ctx->num_commit_graphs_before; i++) {
+ if (i != 0)
+ strbuf_addstr(&message, ", ");
+ strbuf_addf(&message, "'%s'", ctx->commit_graph_filenames_before[i]);
+ }
+ strbuf_addstr(&message, "]");
+ trace2_data_string("commit-graph", the_repository, "graph-before", message.buf);
+ strbuf_release(&message);
}
out: