Skip to content
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

Improve documentation and handling of options with spaces #1040

Open
matthijskooijman opened this issue Sep 29, 2020 · 1 comment
Open

Improve documentation and handling of options with spaces #1040

matthijskooijman opened this issue Sep 29, 2020 · 1 comment

Comments

@matthijskooijman
Copy link

I've been trying to use git log's -S option and get the output displayed in git. My first try was tig -S foo, which just says tig: No revisions match the given arguments.. Originally I thought that tig just didn't support this flag somehow, then I thought there was a bug in forwarding flags to git log and finally, after some strace experiments and re-reading the documentation more carefully, I realized that I should be using tig -Sfoo without a space and it works as expected.

I realize that this is a necessary limitation of tig not knowing how git log's arguments work and it is actually documented in the manpage:

The first command line parameter not starting with "-" is interpreted as being either a revision specification or a path and will end the option parsing.

However, it is not so obvious and easy to miss, so I'd suggest two improvements:

  1. Make it more explicit that spaces should be omitted in the manpage (suggestion below).
  2. Let the error message include the revision arguments tried. E.g. if tig -S foo would say: tig: No revisions match the arguments "foo", then I probably would have realized what was going on earlier.

For 1, how about adding a note under OPTIONS:

Note that this means that any arguments to options should be specified together. For example, run tig -Sfoo instead of tig -S foo, and tig --grep=foo instead of tig --grep foo, otherwise foo will be interpreted as a revision rather than an argument to -S.

@blueyed
Copy link
Contributor

blueyed commented Dec 18, 2020

Note that while tig -Sfoo works, tig log -Sfoo does not.
(and to use arguments with spaces tig -S"foo bar" can be used)

koutcher added a commit that referenced this issue Dec 12, 2022
The text for tig(1) was suggested by Matthijs Kooijman in #1040.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants