MCPcopy Create free account
hub / github.com/git/git / shortlog_add_commit

Function shortlog_add_commit

builtin/shortlog.c:241–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241void shortlog_add_commit(struct shortlog *log, struct commit *commit)
242{
243 struct strbuf oneline = STRBUF_INIT;
244 struct strset dups = STRSET_INIT;
245 struct pretty_print_context ctx = {0};
246 const char *oneline_str;
247
248 ctx.fmt = CMIT_FMT_USERFORMAT;
249 ctx.abbrev = log->abbrev;
250 ctx.date_mode = log->date_mode;
251 ctx.output_encoding = get_log_output_encoding();
252
253 if (!log->summary) {
254 if (log->user_format)
255 pretty_print_commit(&ctx, commit, &oneline);
256 else
257 repo_format_commit_message(the_repository, commit,
258 "%s", &oneline, &ctx);
259 }
260 oneline_str = oneline.len ? oneline.buf : "<none>";
261
262 insert_records_from_trailers(log, &dups, commit, &ctx, oneline_str);
263 insert_records_from_format(log, &dups, commit, &ctx, oneline_str);
264
265 strset_clear(&dups);
266 strbuf_release(&oneline);
267}
268
269static void get_from_rev(struct rev_info *rev, struct shortlog *log)
270{

Callers 2

get_from_revFunction · 0.85

Calls 7

get_log_output_encodingFunction · 0.85
pretty_print_commitFunction · 0.85
strset_clearFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected