{"thread":{"id":"4065","subject":"[PATCH] fmt-patch: output file names to stdout","startedAt":"2006-05-05T01:33:05Z","lastAt":"2006-05-05T01:33:05Z","messageCount":1,"participants":["Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"19539","messageId":"Pine.LNX.4.63.0605050332450.25591@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4065","inReplyTo":null,"subject":"[PATCH] fmt-patch: output file names to stdout","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-05-05T01:33:05Z","receivedAt":"2006-05-05T01:33:05Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\n---\n\n builtin-log.c |    7 ++++++-\n 1 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 576703c..1649f49 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -75,6 +75,8 @@ static int istitlechar(char c)\n \t\t(c >= '0' && c <= '9') || c == '.' || c == '_';\n }\n \n+static FILE *realstdout = NULL;\n+\n static void reopen_stdout(struct commit *commit, int nr)\n {\n \tchar filename[1024];\n@@ -117,7 +119,7 @@ static void reopen_stdout(struct commit \n \t\t\tlen--;\n \t}\n \tstrcpy(filename + len, \".txt\");\n-\tfprintf(stderr, \"%s\\n\", filename);\n+\tfprintf(realstdout, \"%s\\n\", filename);\n \tfreopen(filename, \"w\", stdout);\n }\n \n@@ -149,6 +151,9 @@ int cmd_format_patch(int argc, const cha\n \t\targv++;\n \t}\n \n+\tif (!use_stdout)\n+\t\trealstdout = fdopen(dup(1), \"w\");\n+\n \tprepare_revision_walk(&rev);\n \twhile ((commit = get_revision(&rev)) != NULL) {\n \t\t/* ignore merges */\n-- \n1.3.1.g6d0e-dirty\n"}]}