Re: [PATCH] format-patch: introduce format.outputDirectory configuration
- From
Alexander Kuleshov <kuleshovmail@gmail.com>
- Date
- Jun 19, 2015, 17:27 UTC
- Message-ID
- <CANCZXo7Lyo_Sb=bxF9EgZHV35JfrQZ-CFsM9T4yUjkDBndcp8A@mail.gmail.com>
- In-Reply-To
- <CANCZXo5Nyt+JePQP=kvFsjTaV=xKXduoBqAwp5E0CrEf13QK7g@mail.gmail.com>
Ah, you mean to put this check before. Just tested it and many tests are broken. Will look on it now
2015-06-19 23:19 GMT+06:00 Alexander Kuleshov <kuleshovmail@gmail.com>:
Show 47 quoted lines
>> I thought I made that "if we did not see '-o dir' on the command
>> line, initialize output_directory to what we read from the config"
>> before we make a call to set_outdir().
>>
>> What I am missing?
>>
>> Puzzled... FWIW, IIRC, the patch you are responding to passed the
>> test you added.
>
> Ok, Now we have:
>
> if (!use_stdout)
> output_directory = set_outdir(prefix, output_directory);
> else
> setup_pager();
>
> and
>
> if (output_directory) {
> // test that we did not pass use_stdout and mkdir than
> }
>
> If we didn't pass --stdout and -o the set_outdir will be called
> and there is
>
> static const char *set_outdir(const char *prefix, const char *output_directory)
> {
> //printf("is_absoulte_path %d\n", is_absolute_path(output_directory));
> if (output_directory && is_absolute_path(output_directory))
> return output_directory;
>
> if (!prefix || !*prefix) {
> if (output_directory)
> return output_directory;
> return "./";
> }
> ....
> }
>
> So it returns "./", output_directory will not be null. After this
>
>>> + if (!output_directory && !use_stdout)
>>> + output_directory = config_output_directory;
>
> clause will not be executed never. Or I've missed something?
>
> Thank you.