Skip to content

dev/sg: explicitly check if revision is found locally in autoupdates

Administrator requested to merge sg-update-rev-check into main

Created by: bobheadxi

It seems the old workaround for detecting missing revision no longer works, since the output of git might have changed. Either way we probably shouldn't depend on git's human output so instead we reuse the logic used to generate warnings in sg ci build in the update checker

Test plan

Tag a build with a commit that is not yet in remote:

go build -trimpath -ldflags "-X main.BuildCommit=$(git hash)" -o ./sg ./dev/sg

Run a sg command with -v:

Screenshot 2022-07-13 at 1 33 52 PM

Run an sg command without -v: no output :)

Push to remote, and try again with -v:

image

Merge request reports

Loading