On Wed, Feb 08, 2023 at 08:49:57AM -0500, William Blevins wrote: > This still feels "weird" to me. Other pattern matching tools like grep > and sed don't have exceptions to their behavior like this. > > Can you reference the unit tests that verifies this specific behavior? See commit 631f0f8c4b (ls-remote: do not send ref prefixes for patterns, 2018-10-31), which also adds a test. However, it was just handling existing behavior (which in fact confused another developer and caused a bug which the commit was fixing!). I think the tail-matching behavior is not what we would probably choose today, but that is how it has behaved since 2005, and we are not going to break backwards compatibility in a plumbing tool like ls-remote. There's some discussion in this thread about adding a new option to do prefix-matching, but I don't think any code was ever written: https://lore.kernel.org/git/m2k12g7v5u.fsf@xxxxxxxxx/ Likewise, something more elaborate like full-path globbing or even regex matching would be possible, but would need to be activated by an option. -Peff