All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Kuleshov <kuleshovmail@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jeff King <peff@peff.net>, "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH] format-patch: introduce format.outputDirectory configuration
Date: Fri, 19 Jun 2015 19:33:01 +0600	[thread overview]
Message-ID: <CANCZXo72BscpXKGAtVPt_1QuffcOpTz6nGB+__q0JLisuTaKsQ@mail.gmail.com> (raw)
In-Reply-To: <xmqqd20sd70j.fsf@gitster.dls.corp.google.com>

2015-06-19 3:46 GMT+06:00 Junio C Hamano <gitster@pobox.com>:
> I agree with "later -o should override an earlier one", but I do not
> necessarily agree with "'-o -' should be --stdout", for a simple
> reason that "-o foo" is not "--stdout >foo".
>
> Perhaps something like this to replace builtin/ part of Alexander's
> patch?
>
> @@ -1337,6 +1342,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
>                 die (_("--subject-prefix and -k are mutually exclusive."));
>         rev.preserve_subject = keep_subject;
>
> +       if (!output_directory && !use_stdout)
> +               output_directory = config_output_directory;
> +
>

But there is following condition above:

 if (!use_stdout)
      output_directory = set_outdir(prefix, output_directory);

After which output_directory will be "./" everytime and

>
> +       if (!output_directory && !use_stdout)
> +               output_directory = config_output_directory;
> +
>

will not work here. What if we remove if (output_directory) {}....
and update it as:

    if (!use_stdout) {
        if (!config_output_directory && !output_directory)
            output_directory = set_outdir(prefix, output_directory);
        else if (config_output_directory)
            output_directory = config_output_directory;

        if (mkdir(output_directory, 0777) < 0 && errno != EEXIST)
            die_errno(_("Could not create directory '%s'"),
                  output_directory);
    }
    else
        setup_pager();

?

  parent reply	other threads:[~2015-06-19 13:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-18 11:18 [PATCH] format-patch: introduce format.outputDirectory configuration Alexander Kuleshov
2015-06-18 17:13 ` Junio C Hamano
2015-06-18 19:57   ` Jeff King
2015-06-18 20:05     ` Junio C Hamano
2015-06-18 20:06       ` Junio C Hamano
2015-06-18 20:13         ` Jeff King
2015-06-18 20:22           ` Jeff King
2015-06-18 21:46             ` Junio C Hamano
2015-06-19  4:14               ` Jeff King
2015-06-19  7:06                 ` Alexander Kuleshov
2015-06-19 13:33               ` Alexander Kuleshov [this message]
2015-06-19 15:59                 ` Junio C Hamano
2015-06-19 17:19                   ` Alexander Kuleshov
2015-06-19 17:27                     ` Alexander Kuleshov
2015-06-19 17:49                       ` Alexander Kuleshov
2015-06-19 18:14                       ` Junio C Hamano
2015-06-19 11:34 ` Remi Galan Alfonso
2015-06-19 11:34   ` Alexander Kuleshov

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=CANCZXo72BscpXKGAtVPt_1QuffcOpTz6nGB+__q0JLisuTaKsQ@mail.gmail.com \
    --to=kuleshovmail@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.