diff options
author | Simon Glass <sjg@chromium.org> | 2017-01-13 13:47:08 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-01-14 10:20:02 -0800 |
commit | b6c1d0d4907b0b2cd605c44a5024e7188c34a335 (patch) | |
tree | 1aabdc829b3814ab11bec32f1ca66fa66ed66199 | |
parent | dfced0c19148edcd1b57662ebccc2bb611383c92 (diff) | |
download | chrome-ec-b6c1d0d4907b0b2cd605c44a5024e7188c34a335.tar.gz |
Makefile: Suppress 'Not a git repository' errors
We get a lot of these errors when running the EC Makefile from an ebuild.
They are not useful since of course there is no git repo when the source
code is built from a copy. An empty date (as produced in this case) is
presumably good enough.
Suppress these errors by redirecting stderr.
BUG=chromium:680243
BRANCH=none
TEST=V=0 emerge-reef chromeos-ec; See that the git output is gone
Change-Id: Ia3d1e2046c87e0ca88d0c18e432467f9d23b7e9f
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/428156
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rwxr-xr-x | util/getversion.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/util/getversion.sh b/util/getversion.sh index d91ec771c4..6b20db4171 100755 --- a/util/getversion.sh +++ b/util/getversion.sh @@ -118,6 +118,8 @@ if [ -n "$global_dirty" ]; then echo "#define DATE \"$(date '+%F %T')\"" else echo "/* Repo is clean, use the commit date of the last commit */" - gitdate=$(git log -1 --format='%ci' HEAD | cut -d ' ' -f '1 2') + # If called from an ebuild we won't have a git repo, so redirect stderr + # to avoid annoying 'Not a git repository' errors. + gitdate=$(git log -1 --format='%ci' HEAD 2>/dev/null | cut -d ' ' -f '1 2') echo "#define DATE \"${gitdate}\"" fi |