threads / patch / 4065

patchfmt-patch: output file names to stdout

Subject: [PATCH] fmt-patch: output file names to stdout

## tl;dr

One message between May 5, 2006 and May 5, 2006. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Johannes Schindelin· May 5, 2006, 01:33 UTC · lore
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 builtin-log.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
Show changes to builtin-log.c +6 −1
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 
 			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 cha
 		argv++;
 	}
 
+	if (!use_stdout)
+		realstdout = fdopen(dup(1), "w");
+
 	prepare_revision_walk(&rev);
 	while ((commit = get_revision(&rev)) != NULL) {
 		/* ignore merges */
-- 
1.3.1.g6d0e-dirty

← back to recent threads