1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-05 09:26:12 +02:00
git/shortlog.h
Jeff King 92338c450b shortlog: add grouping option
In preparation for adding more grouping types, let's refactor the
committer/author grouping code and add a user-facing option that binds
them together. In particular:

  - the main option is now "--group", to make it clear
    that the various group types are mutually exclusive. The
    "--committer" option is an alias for "--group=committer".

  - we keep an enum rather than a binary flag, to prepare
    for more values

  - we prefer switch statements to ternary assignment, since
    other group types will need more custom code

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-27 12:21:05 -07:00

37 lines
568 B
C

#ifndef SHORTLOG_H
#define SHORTLOG_H
#include "string-list.h"
struct commit;
struct shortlog {
struct string_list list;
int summary;
int wrap_lines;
int sort_by_number;
int wrap;
int in1;
int in2;
int user_format;
int abbrev;
enum {
SHORTLOG_GROUP_AUTHOR = 0,
SHORTLOG_GROUP_COMMITTER,
} group;
char *common_repo_prefix;
int email;
struct string_list mailmap;
FILE *file;
};
void shortlog_init(struct shortlog *log);
void shortlog_add_commit(struct shortlog *log, struct commit *commit);
void shortlog_output(struct shortlog *log);
#endif