diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-12-07 17:19:31 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-12-08 11:32:05 -0800 |
commit | 4602c17d8911e14d537f6f87db02faab6e3f5d69 (patch) | |
tree | 354446eb2cdfa8912192f15cc2b007c5a9aa67ff /builtin-shortlog.c | |
parent | 1e931cb4d197e30504b6d2cc77b0b045b0167df6 (diff) | |
download | git-4602c17d8911e14d537f6f87db02faab6e3f5d69.tar.gz git-4602c17d8911e14d537f6f87db02faab6e3f5d69.tar.xz |
git-shortlog -e: show e-mail address as well
This option shows the author's email address next to the name.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-shortlog.c')
-rw-r--r-- | builtin-shortlog.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/builtin-shortlog.c b/builtin-shortlog.c index b9cc13444..13df0c668 100644 --- a/builtin-shortlog.c +++ b/builtin-shortlog.c @@ -11,6 +11,7 @@ static const char shortlog_usage[] = "git-shortlog [-n] [-s] [<commit-id>... ]"; static char *common_repo_prefix; +static int email; static int compare_by_number(const void *a1, const void *a2) { @@ -57,6 +58,14 @@ static void insert_one_record(struct path_list *list, len--; namebuf[len] = '\0'; } + else + len = strlen(namebuf); + + if (email) { + size_t room = sizeof(namebuf) - len - 1; + int maillen = eoemail - boemail + 1; + snprintf(namebuf + len, room, " %.*s", maillen, boemail); + } buffer = xstrdup(namebuf); item = path_list_insert(buffer, list); @@ -219,6 +228,9 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix) else if (!strcmp(argv[1], "-s") || !strcmp(argv[1], "--summary")) summary = 1; + else if (!strcmp(argv[1], "-e") || + !strcmp(argv[1], "--email")) + email = 1; else if (!prefixcmp(argv[1], "-w")) { wrap_lines = 1; parse_wrap_args(argv[1], &in1, &in2, &wrap); |