Commit 5f2ba637 by Jamie Madill Committed by Commit Bot

Update commit ID when the git ref changes.

Previously we were only regenerating the commit ID when the .git/HEAD file changed. When working on a branch the HEAD file doesn't change. It points to a ref like refs/heads/master that changes. So we can read back the contents of .git/HEAD using GN's read_file command and then mark the commit id as dirty when the ref changes. Should alleviate some of the shader cache problems. Bug: angleproject:4448 Change-Id: I1c39b12af3455e3620d80bec92a15f9921d9163b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2358519Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarIan Elliott <ianelliott@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 65ccbd71
...@@ -477,6 +477,11 @@ action("commit_id") { ...@@ -477,6 +477,11 @@ action("commit_id") {
exec_script("src/commit_id.py", [ "check" ], "value") == 1) { exec_script("src/commit_id.py", [ "check" ], "value") == 1) {
# commit id should depend on angle's HEAD revision # commit id should depend on angle's HEAD revision
inputs = [ ".git/HEAD" ] inputs = [ ".git/HEAD" ]
branch = read_file(".git/HEAD", "string")
result = string_split(branch)
if (result[0] == "ref:") {
inputs += [ ".git/" + result[1] ]
}
} }
args = [ args = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment