phil294 / GitLG

A free, interactive Git UI for VSCode
MIT License
156 stars 16 forks source link

improve error message when git input was modified #66

Closed hansu closed 9 months ago

hansu commented 11 months ago

After using my VM after some time again, I get this error when trying to run this extension:

grafik

When I run Code it with a clean --user-data-dir then it works. But I don't want to delete my user data dir. Any hints what this could cause?

phil294 commented 11 months ago

"unknown visuals at row 0" means the output returned from git's log command has an unknown format. I guess this can happen if you have changed the log command (very top in the main view)? Perhaps you have adjusted something there which used to work, but then I broke it unintentionally in a subsequent update. Could you share what this field holds for you currently, if it is shown as modified? Before clicking on "Reset", as then the error will not be reproducible anymore.

Otherwise, you could try setting the config flag verbose-logging to true. Afterwards, you can open the "Output" view and select git log --graph. This view should also contain the error, and more information around it - such as said git output. If you paste the relevant information here, I'm sure we'll find something.

Anyway, the error handling should be improved here: If any of the git inputs (including the main log one) return an error and the user has altered the input command, there should be a message suggesting them to click "reset" to potentially fix the error. These kinds of errors are rather unique to this extension, I don't think there is an easy way to prevent them, really. I guess that's the downside of exposing such powerful functionality to the extension user :|

hansu commented 11 months ago

The line was log --graph --oneline -n 50 --skip=0 --all {STASH_REFS} --invert-grep --grep="^untracked files on " --grep="^index on " --author-date-order

and it seems the --pretty={EXT_FORMAT} was missing.

Thanks for that hint, now it works again :smile:

phil294 commented 11 months ago

ok great

allow me to reopen so to keep a reminder to myself to take care of the error message problem from my previous message

hansu commented 11 months ago

allow me to reopen so to keep a reminder to myself to take care of the error message problem from my previous message

Sure :)