From: Johannes Schindelin Date: Fri, 5 May 2006 01:33:05 +0000 (+0200) Subject: fmt-patch: output file names to stdout X-Git-Tag: v1.4.0-rc1~76^2~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=81f3a188a3781fa4a818ed27ee83430682a98ec4;p=git.git fmt-patch: output file names to stdout Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- diff --git a/builtin-log.c b/builtin-log.c index 576703c47..1649f4943 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 */