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

Fix completion when password name contains quotes #2150

Merged
merged 1 commit into from
Mar 11, 2022

Conversation

pdecat
Copy link
Contributor

@pdecat pdecat commented Mar 9, 2022

This PR fixes shell completion when some passwords names contain single or double quotes.

Without this change, completion either returns nothing or inconsistent results depending on the number of quotes passwords matching the requested completion contain.

TODO:

  • add unit tests.

@pdecat pdecat force-pushed the fix_completion_with_quotes branch 3 times, most recently from da82bd7 to 8353b32 Compare March 9, 2022 00:50
AnomalRoil
AnomalRoil previously approved these changes Mar 9, 2022
@AnomalRoil
Copy link
Member

Lgtm, thanks!

@pdecat
Copy link
Contributor Author

pdecat commented Mar 9, 2022

Thanks for the quick review @AnomalRoil!

CommitCheck — Your PR description is not valid.

Not sure why this check fails, any idea?

@AnomalRoil
Copy link
Member

You need to add a RELEASE_NOTES tag as explained here, I think:
https://github.com/gopasspw/gopass/blob/master/CONTRIBUTING.md#pull-request-checklist

RELEASE_NOTES=[BUGFIX] Fix completion when password name contains
quotes.

Signed-off-by: Patrick Decat <pdecat@gmail.com>
@pdecat pdecat force-pushed the fix_completion_with_quotes branch from dace13e to e6d332c Compare March 9, 2022 09:37
@pdecat
Copy link
Contributor Author

pdecat commented Mar 9, 2022

Thanks, should have looked there 🤦‍♂️

Added the RELEASE_NOTES tag but CommitCheck is still complaining: Your PR description is not valid.

Should I have used a template of some sort or link to an issue for the PR description?

@AnomalRoil
Copy link
Member

AnomalRoil commented Mar 9, 2022

I'm not sure what's wrong. We can merge that nonetheless, so don't worry.

Btw, I've just tested your code locally and it doesn't seem to work like I expected it.
What are the steps you use to reproduce the issue in the first place?

Does it display with a " in the completion output on your side now?

@AnomalRoil
Copy link
Member

Ah, I could reproduce it, the default completion for bash was calling my system-wide install of gopass:

$ ./gopass --generate-bash-completion | grep tests
tests/tes\\\"t
$ gopass --generate-bash-completion | grep tests
tests/tes"t

Copy link
Member

@dominikschulz dominikschulz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dominikschulz dominikschulz merged commit b052778 into gopasspw:master Mar 11, 2022
@pdecat pdecat deleted the fix_completion_with_quotes branch March 12, 2022 04:35
kpitt pushed a commit to kpitt/gopass that referenced this pull request Jul 21, 2022
RELEASE_NOTES=[BUGFIX] Fix completion when password name contains
quotes.

Signed-off-by: Patrick Decat <pdecat@gmail.com>
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

Successfully merging this pull request may close these issues.

3 participants