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

Re: [PATCH] format-patch: introduce format.outputDirectory configuration

From
Alexander Kuleshov <kuleshovmail@gmail.com>
Date
Jun 19, 2015, 13:33 UTC
Message-ID
<CANCZXo72BscpXKGAtVPt_1QuffcOpTz6nGB+__q0JLisuTaKsQ@mail.gmail.com>
In-Reply-To
<xmqqd20sd70j.fsf@gitster.dls.corp.google.com>
2015-06-19 3:46 GMT+06:00 Junio C Hamano <gitster@pobox.com>:
Show 15 quoted lines
> 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
Show 5 quoted lines
>
> +       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();
?
Previous: Alexander KuleshovNext: Junio C Hamano
Message 11 of 18 in “format-patch: introduce format.outputDirectory configuration”
  1. format-patch: introduce format.outputDirectory configurationAlexander Kuleshov, Jun 18, 2015
  2. Junio C HamanoJun 18, 2015
  3. Jeff KingJun 18, 2015
  4. Junio C HamanoJun 18, 2015
  5. Junio C HamanoJun 18, 2015
  6. Jeff KingJun 18, 2015
  7. Jeff KingJun 18, 2015
  8. Junio C HamanoJun 18, 2015
  9. Jeff KingJun 19, 2015
  10. Alexander KuleshovJun 19, 2015
  11. Alexander KuleshovJun 19, 2015
  12. Junio C HamanoJun 19, 2015
  13. Alexander KuleshovJun 19, 2015
  14. Alexander KuleshovJun 19, 2015
  15. Alexander KuleshovJun 19, 2015
  16. Junio C HamanoJun 19, 2015
  17. Remi Galan AlfonsoJun 19, 2015
  18. Alexander KuleshovJun 19, 2015

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.