-
Notifications
You must be signed in to change notification settings - Fork 68
Don't split passthrough options on whitespace #220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't split passthrough options on whitespace #220
Conversation
Otherwise, `stg email send -G '--subject=Latest patch'` translates to `git send-mail '--subject=Latest' 'patch'`, and the command errors with ``` error: `git send-email`: fatal: ambiguous argument 'patch': unknown revision or path not in the working tree. ```
This isn't perfect, but it's better than before. `stg diff --diff-opts=--diff-algorithm=` will present the correct menu, and insertion of an option also works correctly.
98b8b06
to
5aa13ae
Compare
Thank you for this PR, @bb010g. I am in agreement that for the For diff options, the Python implementation allows multiple space-separated options as the value to By only allowing a single git diff option per A question I had was whether git diff options were exposed to the same problem you identified with
So yes, a lot of options that where a user may want a space separated value. I'm in agreement that git diff options should also support values with spaces in them. The most straightforward way of doing this is the change you've made to have the 1:1 mapping between StGit So I am inclined to merge this change. However, I am also going to do some follow-on changes:
|
The --diff-opts option no longer supports multiple options per occurrence. Ref: #220
Since the former --diff-opts option now only supports one git option per occurrence, the singular --diff-opt naming becomes more appropriate. The former --diff-opts option name remains supported as a hidden alias to ease compatibility with older versions of StGit. For `stg email format` and `stg email send`, the --git-opts option is renamed to --git-opt for the same reason. However, since these are new commands for StGit 2.0, the plural naming is not provided as an alias. This also corrects the zsh completion for --diff-opt to allow multiple occurrences. Ref: #220
Thank you! If you're looking at making those sorts of changes, renaming
From what I discovered while writing this patch, I expect both of those to be rather challenging. For the former, you want to accumulate |
Otherwise,
stg email send -G '--subject=Latest patch'
translates togit send-mail '--subject=Latest' 'patch'
, and the command errors withAlso, Zsh completion reuses the current
git
completion, whatever it is. Ideally,stg -C foo diff -D --bar -D --baz=
would complete the same asgit -C foo diff --bar --baz=
, but it's currently limited to completing the same asgit -C foo diff --baz=
, so multi-word options won't complete properly (not that they would before). If Zsh provided a companion associative array toopt_args
that contained indices for each value represented inopt_args
, we could filter to the current word and provide virtually perfect completion, but this will involve submitting a patch to Zsh to enhance bothcomparguments
and_arguments
.