From: Junio C Hamano Date: Thu, 30 Jul 2026 03:41:08 GMT Subject: [PATCH 2/2] stash: reject time-based selectors in drop and pop Message-ID: <20260730034108.765430-3-gitster@pobox.com> In-Reply-To: <20260730034108.765430-1-gitster@pobox.com> get_stash_info_assert() verifies that a revision is a stash reference ('.is_stash_ref'), but it does not verify whether the reference is a positional reflog index as opposed to a time-based selector (such as 'stash@{2.days}'). When subcommands such as 'git stash drop' or 'git stash pop' pass time-based selectors to reflog_delete(), reflog_delete() treats non-integer selectors as expiration cutoff timestamps. Consequently, - 'git stash drop stash@{2.days.ago}' deletes all stash entries older than two days instead of dropping a single entry, and - 'git stash pop stash@{2.days.ago}' applies a single stash entry at that timestamp and then deletes all stash entries older than two days. While the former might be remotely useful, the latter is certainly not. In get_stash_info_assert(), reject references where '.stash_idx' is negative (i.e., a time-based reference was used), ensuring that 'git stash drop' and 'git stash pop' fail early on invalid or date-based stash references. Document that 'git reflog expire --expire=