'Execute a command and returns its output
:param command: argument list to execute.
:param _cwd: working directory, defaults to the current directory.
:param _decode: whether to decode output, defaults to True.
:param _encoding: default encoding, defaults to None (utf-8).
:param _raw: do not strip trailing whitespace.
:param _stdin: optional stdin filehandle.
:returns (status, out, err): exit status, stdout, stderr'

@staticmethod
def execute(command, _cwd=None, _decode=True, _encoding=None, _raw=False, _stdin=None, _stderr=subprocess.PIPE, _stdout=subprocess.PIPE, _readonly=False, _no_win32_startupinfo=False):

    if (not _cwd):
        _cwd = core.getcwd()
    extra = {}
    if hasattr(os, u'setsid'):
        extra[u'preexec_fn'] = os.setsid
    if (not _readonly):
        INDEX_LOCK.acquire()
    (status, out, err) = core.run_command(command, cwd=_cwd, encoding=_encoding, stdin=_stdin, stdout=_stdout, stderr=_stderr, no_win32_startupinfo=_no_win32_startupinfo, **extra)
    if (not _readonly):
        INDEX_LOCK.release()
    if ((not _raw) and (out is not None)):
        out = out.rstrip(u'\n')
    cola_trace = GIT_COLA_TRACE
    if (cola_trace == u'trace'):
        msg = (u'trace:    ' + core.list2cmdline(command))
        Interaction.log_status(status, msg, u'')
    elif (cola_trace == u'full'):
        if (out or err):
            core.stderr((u"%s    ->    %d:    '%s'    '%s'" % (u'    '.join(command), status, out, err)))
        else:
            core.stderr((u'%s    ->    %d' % (u'    '.join(command), status)))
    elif cola_trace:
        core.stderr(u'    '.join(command))
    return (status, out, err)
