From bcdf7cfceb76b81211a9fdc336c1bce51b94a401 Mon Sep 17 00:00:00 2001 From: thesayyn Date: Mon, 1 Apr 2024 19:26:23 -0700 Subject: [PATCH] perf: implement a fast path for diff --- private/tools/diff.bash | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/private/tools/diff.bash b/private/tools/diff.bash index bf963870f..74e01c120 100755 --- a/private/tools/diff.bash +++ b/private/tools/diff.bash @@ -198,6 +198,12 @@ function test_image() { echo "" bazel run $push_label -- --repository $repo_stage --tag $tag_stamped + + if [[ "$(crane digest $repo_origin:$tag_stamped)" == "$(crane digest $repo_stage:$tag_stamped)" ]]; then + echo "👍 $repo_origin:$tag_stamped and $repo_stage:$tag_stamped have identical hash." + return + fi + if ! diffoci diff --pull=always --all-platforms --semantic "$repo_origin:$tag_stamped" "$repo_stage:$tag_stamped"; then echo "" echo " 🔬 To reproduce: bazel run //private/tools:diff -- --only $image_label"