summaryrefslogtreecommitdiff
path: root/builtin-log.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2006-05-05 01:33:05 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-05-05 20:56:01 (GMT)
commit81f3a188a3781fa4a818ed27ee83430682a98ec4 (patch)
tree11cdb917a4f93a81427f8dee5fb536df79c35c80 /builtin-log.c
parent0377db77da3f66b8a2bd2f8a9391d22f7a576e34 (diff)
downloadgit-81f3a188a3781fa4a818ed27ee83430682a98ec4.zip
git-81f3a188a3781fa4a818ed27ee83430682a98ec4.tar.gz
git-81f3a188a3781fa4a818ed27ee83430682a98ec4.tar.bz2
fmt-patch: output file names to stdout
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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/builtin-log.c b/builtin-log.c
index 576703c..1649f49 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -75,6 +75,8 @@ static int istitlechar(char c)
(c >= '0' && c <= '9') || c == '.' || c == '_';
}
+static FILE *realstdout = NULL;
+
static void reopen_stdout(struct commit *commit, int nr)
{
char filename[1024];
@@ -117,7 +119,7 @@ static void reopen_stdout(struct commit *commit, int nr)
len--;
}
strcpy(filename + len, ".txt");
- fprintf(stderr, "%s\n", filename);
+ fprintf(realstdout, "%s\n", filename);
freopen(filename, "w", stdout);
}
@@ -149,6 +151,9 @@ int cmd_format_patch(int argc, const char **argv, char **envp)
argv++;
}
+ if (!use_stdout)
+ realstdout = fdopen(dup(1), "w");
+
prepare_revision_walk(&rev);
while ((commit = get_revision(&rev)) != NULL) {
/* ignore merges */