Skip to content

Commit 9ed2eb2

Browse files
micprogclaude
andcommitted
sess: ignore synthetic bender-tmp-* tags in upstream-ref check
Tim's e3e9241 dropped the bender-tmp- filter from the RevisionNotOnUpstream check on the assumption that the synthetic tags were no longer created. They still are -- `dependency_versions` creates them during update operations to make commits reachable for `git rev-list --all`, and databases populated by bender 0.31.x also contain leftover tmp tags from the old checkout flow. Without the filter the warning was silently suppressed whenever such a tag pointed at the revision being checked out, even when no real upstream ref actually tracked the commit. Restore the explicit filter. Marked as a TODO -- the longer-term fix is to either stop creating these tags or sweep them after use; until then the filter keeps the warning correct on every database shape bender can encounter. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2409d87 commit 9ed2eb2

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/sess.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,16 @@ impl<'io, 'sess: 'io, 'ctx: 'sess> SessionIo<'sess, 'ctx> {
12241224
}
12251225
// Check if the revision is reachable from any upstream branch or
12261226
// tag. If not, warn that the commit may have been removed by a
1227-
// force-push.
1227+
// force-push. Synthetic `bender-tmp-*` tags are excluded: they are
1228+
// created by `dependency_versions` (and may persist in databases
1229+
// populated by older bender versions from the old checkout flow),
1230+
// and they do not represent upstream tracking.
1231+
//
1232+
// TODO: drop this filter once `bender-tmp-*` tags are either no
1233+
// longer created (e.g. by replacing the `rev-list --all` use in
1234+
// `dependency_versions` with a hash-based reachability check) or
1235+
// swept after use; the filter is here to remain correct on
1236+
// databases that still contain such tags.
12281237
let revision_owned = revision.to_string();
12291238
if let Ok(ref_output) = git
12301239
.clone()
@@ -1240,7 +1249,7 @@ impl<'io, 'sess: 'io, 'ctx: 'sess> SessionIo<'sess, 'ctx> {
12401249
None,
12411250
)
12421251
.await
1243-
&& ref_output.trim().is_empty()
1252+
&& !ref_output.lines().any(|line| !line.contains("bender-tmp-"))
12441253
{
12451254
Warnings::RevisionNotOnUpstream(revision.to_string(), name.to_string()).emit();
12461255
}

0 commit comments

Comments
 (0)