summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 596524b)
raw | patch | inline | side by side (parent: 596524b)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Fri, 5 May 2006 02:31:29 +0000 (04:31 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 5 May 2006 21:11:59 +0000 (14:11 -0700) |
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-log.c | patch | blob | history | |
log-tree.c | patch | blob | history |
diff --git a/builtin-log.c b/builtin-log.c
index 43c7ecd5e92a1662765abffa8c2aff65740fe8a8..0027998f1014b0e25f130fcdb53dc47fdc617c1e 100644 (file)
--- a/builtin-log.c
+++ b/builtin-log.c
static FILE *realstdout = NULL;
static char *output_directory = NULL;
-static void reopen_stdout(struct commit *commit, int nr)
+static void reopen_stdout(struct commit *commit, int nr, int keep_subject)
{
char filename[1024];
char *sol;
sol += 2;
/* strip [PATCH] or [PATCH blabla] */
- if (!strncmp(sol, "[PATCH", 6)) {
+ if (!keep_subject && !strncmp(sol, "[PATCH", 6)) {
char *eos = strchr(sol + 6, ']');
if (eos) {
while (isspace(*eos))
int nr = 0, total, i, j;
int use_stdout = 0;
int numbered = 0;
+ int keep_subject = 0;
init_revisions(&rev);
rev.commit_format = CMIT_FMT_EMAIL;
else if (!strcmp(argv[i], "-n") ||
!strcmp(argv[i], "--numbered"))
numbered = 1;
- else if (!strcmp(argv[i], "-o")) {
+ else if (!strcmp(argv[i], "-k") ||
+ !strcmp(argv[i], "--keep-subject")) {
+ keep_subject = 1;
+ rev.total = -1;
+ } else if (!strcmp(argv[i], "-o")) {
if (argc < 3)
die ("Which directory?");
if (mkdir(argv[i + 1], 0777) < 0 && errno != EEXIST)
}
argc = j;
+ if (numbered && keep_subject < 0)
+ die ("-n and -k are mutually exclusive.");
+
argc = setup_revisions(argc, argv, &rev, "HEAD");
if (argc > 1)
die ("unrecognized argument: %s", argv[1]);
commit = list[nr];
rev.nr = total - nr;
if (!use_stdout)
- reopen_stdout(commit, rev.nr);
+ reopen_stdout(commit, rev.nr, keep_subject);
shown = log_tree_commit(&rev, commit);
free(commit->buffer);
commit->buffer = NULL;
diff --git a/log-tree.c b/log-tree.c
index 1ca529d9fefed0d3284c26f5c1503c35ef250779..4a3cd6791b43c9dd98c0237e9b0577deca9d1b37 100644 (file)
--- a/log-tree.c
+++ b/log-tree.c
"Subject: [PATCH %d/%d] ",
opt->nr, opt->total);
subject = buffer;
- } else
+ } else if (opt->total == 0)
subject = "Subject: [PATCH] ";
+ else
+ subject = "Subject: ";
+
printf("From %s Thu Apr 7 15:13:13 2005\n",
sha1_to_hex(commit->object.sha1));
} else {