gitbutler
gitbutler copied to clipboard
filenames with dashes interpreted as ranges
Problem: Can't use filenames directly in but rub - they're parsed as range syntax.
Reproduction:
$ but rub test-simple.md my-branch
Error: Start of range 'test' must match exactly one item
$ but rub "test-simple.md" my-branch
Error: Start of range 'test' must match exactly one item # Even quoted!
$ but rub ./test-simple.md my-branch
Error: Start of range './test' must match exactly one item # Path doesn't help!
This is clearly a bug, but we should also be able to do things like:
You can either rub the file identifier that you see next to each file, or all or part of the file path. For example, in this case to identify the app/models/bookmark.rb file, you can do any of:
xw app/models/ bookmark app/models/bookmark.rb
$ but rub app/models/ my-branch
$ but rub *.rb my-branch
$ but rub bookmark my-branch
I could also validate that clap isn't doing this, instead it's here:
https://github.com/gitbutlerapp/gitbutler/blob/15a089a1673d2451741d33ca173aecc135abb0c9/crates/but/src/rub/mod.rs#L227