This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Upstream git hosts (e.g., GitHub) can treat each tag push as a fresh
event for the purpose of their own notifications; and since fluxd
pushes the sync tag, every sync, unconditionally, this means there are
many many events.
To avoid most of these spurious events, we can push the tag only when
it looks like it's changed. That is, when the HEAD of the branch
points at a different revision to the sync tag. This was already the
condition used to guard logging the sync event.
You might question whether it's safe to push the tag conditionally --
could it result in an invalid state?
in a correct configuration, the sync loop in a single fluxd will be
the only process moving the tag -- so the view in that process is
the only one that matters;
in an incorrect configuration (e.g., more than one fluxd using
the same sync tag), we might fail to push the tag if some other
process has already shifted it to the revision we're looking at. In
that case, we wouldn't want to move it anyway. (And if someone has
shifted the tag to a different revision, well we would have pushed
it before ..)
Fixes #1533.