diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2006-05-05 04:30:52 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-05 14:11:57 -0700 |
commit | 596524b33d50e47e2375cec9e00aff59f0e8278b (patch) | |
tree | e215eb4bddd8aea4b91661d0580eeaffa873abee /builtin-log.c | |
parent | 2448482b3d5e265dd29fa38c3827565f6f2f31ec (diff) | |
download | git-596524b33d50e47e2375cec9e00aff59f0e8278b.tar.gz git-596524b33d50e47e2375cec9e00aff59f0e8278b.tar.xz |
Teach fmt-patch about --numbered
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-log.c')
-rw-r--r-- | builtin-log.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/builtin-log.c b/builtin-log.c index 53a47c9aa..43c7ecd5e 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -137,6 +137,7 @@ int cmd_format_patch(int argc, const char **argv, char **envp) struct rev_info rev; int nr = 0, total, i, j; int use_stdout = 0; + int numbered = 0; init_revisions(&rev); rev.commit_format = CMIT_FMT_EMAIL; @@ -156,6 +157,9 @@ int cmd_format_patch(int argc, const char **argv, char **envp) for (i = 1, j = 1; i < argc; i++) { if (!strcmp(argv[i], "--stdout")) use_stdout = 1; + else if (!strcmp(argv[i], "-n") || + !strcmp(argv[i], "--numbered")) + numbered = 1; else if (!strcmp(argv[i], "-o")) { if (argc < 3) die ("Which directory?"); @@ -186,11 +190,14 @@ int cmd_format_patch(int argc, const char **argv, char **envp) list[nr - 1] = commit; } total = nr; + if (numbered) + rev.total = total; while (0 <= --nr) { int shown; commit = list[nr]; + rev.nr = total - nr; if (!use_stdout) - reopen_stdout(commit, total - nr); + reopen_stdout(commit, rev.nr); shown = log_tree_commit(&rev, commit); free(commit->buffer); commit->buffer = NULL; |