git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dennis Stosberg <dennis@stosberg.net>
To: Junio C Hamano <junkio@cox.net>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>, git@vger.kernel.org
Subject: Re: [PATCH] git-format-patch: add --output-directory long option again
Date: Tue, 6 Jun 2006 20:22:07 +0200	[thread overview]
Message-ID: <20060606182206.G36caaa7f@leonov.stosberg.net> (raw)
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 <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.

      reply	other threads:[~2006-06-06 18:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-06 14:19 [PATCH] git-format-patch: add --output-directory long option again Dennis Stosberg
2006-06-06 14:53 ` Johannes Schindelin
2006-06-06 15:46 ` Junio C Hamano
2006-06-06 18:22   ` Dennis Stosberg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060606182206.G36caaa7f@leonov.stosberg.net \
    --to=dennis@stosberg.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).