From: Dennis Stosberg Date: Tue, 06 Jun 2006 18:22:07 GMT Subject: Re: [PATCH] git-format-patch: add --output-directory long option again Message-ID: <20060606182206.G36caaa7f@leonov.stosberg.net> In-Reply-To: <7vwtbuthgw.fsf@assigned-by-dhcp.cox.net> Junio C Hamano wrote: > > + 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. > 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 :: Use 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.