Re: [PATCH 83/83] builtin/am: use apply api in run_apply()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dscho,

On Mon, Apr 25, 2016 at 5:03 PM, Johannes Schindelin
<Johannes.Schindelin@xxxxxx> wrote:
> Hi Chris,
>
> On Sun, 24 Apr 2016, Christian Couder wrote:
>
>> [...]
>>       /*
>>        * If we are allowed to fall back on 3-way merge, don't give false
>>        * errors during the initial attempt.
>>        */
>> +
>>       if (state->threeway && !index_file) {
>> -             cp.no_stdout = 1;
>> -             cp.no_stderr = 1;
>> +             save_stdout_fd = dup(1);
>> +             dup_devnull(1);
>> +             save_stderr_fd = dup(2);
>> +             dup_devnull(2);
>
> I wonder. It should be possible to teach the apply function to be quiet by
> default, yes? That would be more elegant than dup()ing back and forth.

Yes, it could be possible, but it could mean many changes not only in
the apply functions, but in possibly many other places as well. I
didn't check, but for example if an apply function calls a function
from another part of git and this function uses error(...) in case of
error, I would have to change this function too.

I could also introduce a hack like a global variable that would tell
error() to shut up, but I am not sure that would be more elegant.

Thanks,
Christian.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]