| name | safe-pull-and-rollback |
| description | Tag-before-pull pattern with diff, rollback, and cross-machine sharing. Use when the user is about to pull from origin and wants a safety net, or wants to compare what's about to land, or wants to revert after a pull broke something. |
Safe pull / rollback / compare
The drone-follow branch (hailo_drone_follow) tends to drift far ahead of local checkouts (we've seen 28-commit-ahead pulls touching 23 files). Always tag before fast-forwarding so you can A/B test and roll back.
Tag the current tip
TAG="pre-pull-hailo_drone_follow-$(date +%Y%m%d)"
git tag -a "$TAG" -m "Local hailo_drone_follow tip before pulling from origin"
git rev-parse "$TAG^{commit}"
Use an annotated tag (-a), not a lightweight tag — annotated tags carry a message, push cleanly, and survive git gc better.
Inspect what's about to land
git fetch --quiet
git log HEAD..origin/hailo_drone_follow --oneline
git diff --stat HEAD..origin/hailo_drone_follow | head -30
git diff --stat HEAD..origin/hailo_drone_follow -- \
community/apps/hailo_drone_follow/drone_follow/pipeline_adapter/
For a deeper read on tracking-affecting changes, see ../../memory/tracking_callback_risks.md.
Pull
git pull --ff-only
Fast-forward only — if it can't, your local has commits the remote doesn't and you should rebase or merge deliberately.
Diff against the saved tag (post-pull)
git diff <TAG>..HEAD
git diff <TAG>..HEAD -- <path>
git log <TAG>..HEAD --oneline
Roll back
git reset --hard <TAG>
Or, to look around without moving the branch:
git checkout <TAG>
git switch -
Push the tag (so other machines / the air unit can use it)
git push origin <TAG>
git ls-remote --tags origin <TAG>
On the other machine:
git fetch --tags origin
git checkout <TAG>
git switch -c pre-pull-test <TAG>
When you have uncommitted changes
A simple git checkout <other-branch> works only if the files you've modified have identical content on both branches. Otherwise:
- Tracked-file changes against a divergent base ⇒ stash first:
git stash --include-untracked.
- Untracked files always travel with
checkout — no stash needed for them.
Don'ts
- Don't
git pull (without --ff-only) when behind — it'll merge and create a noisy commit.
- Don't
git reset --hard without first verifying the tag exists: git rev-parse <TAG>.
- Don't push tags to origin before confirming the user wants them shared. Tags pushed accidentally are awkward to remove (
git push origin :refs/tags/<TAG> is the cleanup but takes a round-trip).