The series has two patches. The first collects reflogs from --all and from refs named on the command line into one list and expires them in a single loop. The motivation is that two separate copies of the callback setup can drift apart, as d1536ac3e2 showed, when the named-ref copy lacked dry_run. Junio had suggested a single loop in review of that fix. Output and exit status are meant to stay the same.

The second patch skips a reflog already processed in the run. Today, naming a ref twice, using two names for the same ref such as "main" and "refs/heads/main", or naming a ref that --all already covers makes the reflog be processed and reported repeatedly. With --updateref, naming a ref twice can also lose entries. The first pass can move the ref to the last entry it kept, and the second pass then prunes entries that mention commits the new tip does not reach. The patch adds tests for the repeated output and for --updateref.

Patrick Steinhardt said the change makes sense. He added that he would not be surprised if some users rely on the old behavior, intentionally or by accident. He agreed the change is already an improvement and need not cover every known edge case. He asked for a NEEDSWORK comment noting that the check does not work for per-worktree refs.

The latest version, described as changed since v3, adds a NEEDSWORK comment saying the check does not catch names that reach a reflog through a worktree prefix. The patches carry an Assisted-by: Claude Sonnet 5.5 trailer.