{"thread":{"id":"6484","subject":"[PATCH] format-patch: fix bug with --stdout in a subdirectory","startedAt":"2007-01-23T03:38:28Z","lastAt":"2007-01-23T03:38:28Z","messageCount":1,"participants":["Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"32363","messageId":"20070123033828.GA22599@coredump.intra.peff.net","threadId":"6484","inReplyTo":null,"subject":"[PATCH] format-patch: fix bug with --stdout in a subdirectory","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-01-23T03:38:28Z","receivedAt":"2007-01-23T03:38:28Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"We set the output directory to the git subdirectory prefix if one has\nnot already been specified. However, in the case of --stdout, we\nexplicitly _don't_ want the output directory to be set. The result was\nthat \"git-format-patch --stdout\" in a directory besides the project root\nproduced the \"standard output, or directory, which one?\" error message.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n builtin-log.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 9691296..d4bf2dc 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -482,7 +482,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \tif (!rev.diffopt.text)\n \t\trev.diffopt.binary = 1;\n \n-\tif (!output_directory)\n+\tif (!output_directory && !use_stdout)\n \t\toutput_directory = prefix;\n \n \tif (output_directory) {\n-- \n1.5.0.rc2.g8cad-dirty\n"}]}