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

Git log with custom format - incorrect escaping #46

Closed
asvetliakov opened this issue Oct 2, 2018 · 8 comments
Closed

Git log with custom format - incorrect escaping #46

asvetliakov opened this issue Oct 2, 2018 · 8 comments
Labels

Comments

@asvetliakov
Copy link
Contributor

asvetliakov commented Oct 2, 2018

This command

wslgit.exe log --name-status --format="%x3c%x2ff%x3e%n%x3cr%x3e %H%n%x3ca%x3e %an%n%x3ce%x3e %ae%n%x3cd%x3e %at%n%x3cp%x3e %P%n%x3cs%x3e%n%B%n%x3c%x2fs%x3e%n%x3cf%x3e" -n200 --follow -- packages/backendjs/src/processing/portal/chatHandlers/IgnoreChat.ts

Results to:

fatal: bad revision '"--format=%x3c%x2ff%x3e%n%x3cr%x3e %H%n%x3ca%x3e %an%n%x3ce%x3e %ae%n%x3cd%x3e %at%n%x3cp%x3e %P%n%x3cs%x3e%n%B%n%x3c%x2fs%x3e%n%x3cf%x3e"'

VSCode GitLens plugin is using such custom formats for log & stash commands

@andy-5 andy-5 added the bug label Oct 4, 2018
@andy-5
Copy link
Owner

andy-5 commented Oct 4, 2018

Thanks for bringing this up. I need to investigate what exactly is going on here.
I saw you also created a PR for GitLens to help with this - have you confirmed that the spaces in the format string cause the problem?

@asvetliakov
Copy link
Contributor Author

asvetliakov commented Oct 4, 2018

Yes, without spaces it works normally (after merging rev-parse fix)

Edit: also looks like it sends --format command without surrounding quotes, i.e. just --format=%x3c%x2ff%x3e%n%x3cr%x3e %H%n%x3ca%x3e ...., so actually the error is quite different

@diablodale
Copy link
Contributor

I am seeing behaviors in other parts of vscode that I think are related. For example, the bottom left changing branches doesn't list the branches in the pulldown that appears. From what I can debug, it is related to spaces in the values of parameters.
Investigating...

@diablodale
Copy link
Contributor

@asvetliakov , in your specific computer/wslgit setup, are you using the advanced feature where you have to set either WSLGIT_USE_INTERACTIVE_SHELL and/or BASH_ENV ?

I ask because I have isolated a behavior related to it and the escaping of spaces.

@asvetliakov
Copy link
Contributor Author

asvetliakov commented Oct 13, 2018

@diablodale Yes, i'm using WSLGIT_USE_INTERACTIVE_SHELL=false. However unsetting it doesn't seem to change anything

@diablodale
Copy link
Contributor

diablodale commented Oct 14, 2018

I found some issues and I've made a fix and pull request.
@asvetliakov , compile the code in my PR that should link here. Or if you don't have that ability and trust, here is a release compile of the same code.
(removed private compiled binary)

I tested this with your original test case above - it works now.
I also tested this against six combinations including spaces in working directory and parameters.
I would appreciate feedback if this works better for you both.

@asvetliakov
Copy link
Contributor Author

It fixed it. You're my hero!

@andy-5
Copy link
Owner

andy-5 commented Oct 17, 2018

@diablodale Thank you for the fix, works great so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants