git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] format-patch: fix bug with --stdout in a subdirectory

From
Jeff King <peff@peff.net>
Date
Jan 23, 2007, 03:38 UTC
Message-ID
<20070123033828.GA22599@coredump.intra.peff.net>

We set the output directory to the git subdirectory prefix if one has not already been specified. However, in the case of --stdout, we explicitly _don't_ want the output directory to be set. The result was that "git-format-patch --stdout" in a directory besides the project root produced the "standard output, or directory, which one?" error message.

Signed-off-by: Jeff King <peff@peff.net>
---
 builtin-log.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c
index 9691296..d4bf2dc 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -482,7 +482,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 	if (!rev.diffopt.text)
 		rev.diffopt.binary = 1;
 
-	if (!output_directory)
+	if (!output_directory && !use_stdout)
 		output_directory = prefix;
 
 	if (output_directory) {
-- 
1.5.0.rc2.g8cad-dirty
Message 1 of 1 in “format-patch: fix bug with --stdout in a subdirectory”
  1. format-patch: fix bug with --stdout in a subdirectoryJeff King, Jan 23, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.