GitFiend / Support

Public repo for GitFiend questions and issues
118 stars 7 forks source link

Diffs view is always blank #182

Open hippydream opened 1 year ago

hippydream commented 1 year ago

Hi, I found this very promising tool and it's looking great so far, so well done. Unfortunately I'm experiencing a weird issue where the diffs view is always blank (see screenshot).

I tried re-installing, clearing the cache, clearing the GitFiend settings dir, but no success.

The inspector console doesn't show errors either (just a "warning: git-credential-manager-core was renamed to git-credential-manager".. shouldn't be related though). Looking at other bug reports, I checked the load_wip_patches network request when a file is selected in the modified files list, but the returned payload is an empty array.. not sure if that's where the diffs are fetched: {"Ok":[]}

I tried several github repos and the Qt and Qt Creator repos.. always getting a blank view.

PS: Windows 11, 64bit, latest GitFiend 0.42.1.0 and latest git for Windows (2.42.0)

bug

GitFiend commented 1 year ago

Thanks for the bug report, I'll take a look into this today.

GitFiend commented 1 year ago

I just tried to replicate this and failed. Windows 11, latest Git installed and even the same qt creator repo and commit. It could be you have some git config I haven't handled?

The load_wip_patches request is your work in progress/ changes. The one that should be returning the commit code changes is "load_hunks". I suspect this is returning null. I've uploaded a pre-release of gitfiend that returns the error message instead of null for load_hunks. https://github.com/GitFiend/Support/releases/tag/0.43.0

hippydream commented 1 year ago

We are on "slightly" different time zones I think.. it's morning here at the moment :)

Anyway.. I realized I tried everything except rename my .gitconfig to see if it fixed it and I can confirm it works, so it is something in my config file. I have that file for ages and I can't think of anything specific that could cause the problem but I'll find out with the well established method of adding back each setting until I break the app again :)

Might not be something odd in my config that you don't need to care about.. I'll let you know soon.

hippydream commented 1 year ago

Problem found. I had a [color] section with these values:

[color] ui = always diff = always status = always branch = always

I can't remember when I added them but the diff and ui settings will trigger the problem. Switching the values to "auto" ("omit color code output if the output stream is redirected to a file or piped to another process") will fix the issue while retaining colored output when used from the command line.

I don't think you'll have to fix anything but at least these notes could be useful to someone else :)

Thanks again for your feedback.. and I'm sorry I didn't realize it earlier. This project is looking very promising so good luck with it!

GitFiend commented 1 year ago

Oh interesting. Thanks for the investigation and info. It looks like protecting against is pretty straight forward, so I think I'll add it.

alr888rav commented 1 year ago

I have the same issue. Where can I find these color settings?

GitFiend commented 1 year ago

hippydream was referring to custom settings in .gitconfig. If you have been modifying this with overrides for git commands then it could cause an issue. You could also try out the latest build 0.43.2 (Beta) at https://gitfiend.com/all-downloads which contains bug fixes.

alr888rav commented 1 year ago

Thank you, new version works as expected.

hippydream commented 1 year ago

I can also confirm that the latest beta release fixes the issue, well done :-)

@alr888rav: I had my color settings in the global C:\Users\\<username>\.gitconfig (should be ~/.gitconfig on Linux). You can also set them from the command line with, for instance, "git config --global color.ui auto". The "Customizing Git" page on the git website has a small section about colors, in case you are curious.