HomePhabricator

[CMAKE] Silent git error output when running from cmake

Description

[CMAKE] Silent git error output when running from cmake

Summary:
The standard output is set to a variable and the result code is handled
by the cmake script, so there is no need for displaying the errors.
The output displayed on screen can be confusing in case of an error,
i.e:

fatal: not a git repository (or any of the parent directories): .git

when building from a github archive and not a repo
clone (see https://github.com/Bitcoin-ABC/bitcoin-abc/issues/371).

Test Plan:
Don't run the test plan on your local dev repo. Clone a new one and
remove the .git directory.

cmake -GNinja ..
ninja check

There should be no fatal error output message.

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D5455

Details

Provenance
FabienAuthored on Mar 9 2020, 16:41
FabienPushed on Mar 9 2020, 17:19
Reviewer
Restricted Project
Differential Revision
D5455: [CMAKE] Silent git error output when running from cmake
Parents
rABC8478751dace1: [CMAKE] Fix FindBerkeleyDB suffix paths
Branches
Unknown
Tags
Unknown