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

Re: [PATCH] git-format-patch: add --output-directory long option again

From
DSDennis Stosberg <dennis@stosberg.net>
Date
Jun 6, 2006, 18:22 UTC
Message-ID
<20060606182206.G36caaa7f@leonov.stosberg.net>
In-Reply-To
<7vwtbuthgw.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 9 quoted lines
> > +	if (output_directory && !stdout) {
> > +		if (mkdir(output_directory, 0777) < 0 && errno != EEXIST)
> > +			die("Could not create directory %s",
> > +			    output_directory);
> > +	}
> > +
> 
> This code couldn't have been tested -- you meant to say
> "use_stdout" here, not "stdout".
Sorry.  My version compiled and ran cleanly, but I was blinded by my
goal: I wanted the directory to be _not_ created and checked that,
but I didn't make sure, that the directory really existed in the
other case, since Git didn't produce an error.
 
Show 5 quoted lines
> How about this instead?
> [...]
> +	if (output_directory) {
> +		if (use_stdout)
> +			die("standard output, or directory, which one?");

Looks good. This piece changes behaviour; it no longer matches the docs.

Regards, Dennis

---
 Documentation/git-format-patch.txt |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index 493cac2..4ca0014 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -40,8 +40,7 @@ OPTIONS
 -------
 -o|--output-directory <dir>::
 	Use <dir> to store the resulting files, instead of the
-	current working directory. This option is ignored if
-	--stdout is specified.
+	current working directory.
 
 -n|--numbered::
 	Name output in '[PATCH n/m]' format.
Previous: Junio C Hamano
Message 4 of 4 in “git-format-patch: add --output-directory long option again”
  1. git-format-patch: add --output-directory long option againDennis Stosberg, Jun 6, 2006
  2. Johannes SchindelinJun 6, 2006
  3. Junio C HamanoJun 6, 2006
  4. Dennis StosbergJun 6, 2006

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.