Re: [PATCH 83/83] builtin/am: use apply api in run_apply()
From: Christian Couder <hidden>
Date: 2016-06-16 02:19:11
Hi Dscho, On Mon, Apr 25, 2016 at 5:03 PM, Johannes Schindelin [off-list ref] wrote:
Hi Chris, On Sun, 24 Apr 2016, Christian Couder wrote:quoted
[...] /* * 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.